Ubuntu

upstart assumes we can stop tracing processes when exec() is called, breaks 'expect daemon' for cups

Reported by Steve Langasek on 2011-09-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
upstart
Undecided
Unassigned
upstart (Ubuntu)
Medium
James Hunt

Bug Description

trying to improve the cups upstart job in Ubuntu to use 'expect daemon' so that the service is reliably up before upstart proceeds on to running the post-start script, I find that this doesn't work because cups re-execs itself with different commandline options before daemonizing. upstart init/job_process.c has the following:

/*
 [...]
 * We assume that if the job calls exec that it's finished forking so we can
 * drop the trace entirely; we have no interest in tracing the new child.
 **/
static void
job_process_trace_exec (Job *job,
                        ProcessType process)

Well, cups obviously violates this expectation, because it unavoidably re-execs itself.

Is the upstart assumption wrong? Is this sanely *fixable* without causing knock-on effects?

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: upstart 1.3-0ubuntu9
ProcVersionSignature: Ubuntu 3.0.0-11.18-generic 3.0.4
Uname: Linux 3.0.0-11-generic x86_64
ApportVersion: 1.23-0ubuntu1
Architecture: amd64
Date: Tue Sep 20 11:03:08 2011
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: upstart
UpgradeStatus: Upgraded to oneiric on 2011-06-27 (85 days ago)

Related branches

Steve Langasek (vorlon) wrote :
Changed in upstart (Ubuntu):
importance: Undecided → Medium
assignee: nobody → James Hunt (jamesodhunt)
Steve Langasek (vorlon) wrote :

I dug into this further and discovered to my surprise that cupsd doesn't support daemonizing at all, it only supports backgrounding. And of course it forks before it calls listen() on its sockets. So frankly, I'm not sure how I thought "expect daemon" was going to help here.

Now, even if we patched cupsd to daemonize, or fixed bug #530779, upstart's handling of the reexec would *still* be a problem. So I still think this is a bug in its own right that we should fix.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers