Comment 5 for bug 690640

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 690640] Re: dh_installinit upstart support start a job in postinst script regardless of previous status

On Tue, Jan 25, 2011 at 08:04:15PM -0000, Clint Byrum wrote:

> With upstart jobs, its not really possible to know if a job should be
> running by looking at the filesystem. So this seems to be missing a fix
> that would, as Alessandro said, query and save the status when the stop
> action is run during preinst, and return the job to the goal it was in
> pre-upgrade.

That's not a policy-correct solution for service handling. There needs to
be a method for distinguishing between jobs that have been administratively
disabled or that aren't supposed to run because of the current policy (e.g.
runlevel), and those that are not running for some other reason (such as a
prior package upgrade failure).

Implementing support for such information is on the upstart roadmap, but it
won't be reasonably backportable to lucid.

> The policy-rc.d stuff would work too, but that is less discoverable and
> won't actually disable the upstart job at boot time, so I think before we
> discuss lucid, we should look at whether or not whats been done now is a
> complete solution.

Yes, the fix I implemented has two main purposes:

 - to make upstart services respect policy-rc.d which, awkward as it is, is
   the interface Debian policy gives us to work with for setting service
   policies
 - to fix the use of '|| :' which causes maintainer scripts to ignore *all*
   causes of job start failures, instead of just those caused by trying to
   start an already-running job

This doesn't fix all the problems... just those that we can fix, right now,
in debhelper. It's also the *only* change we should need to make in
debhelper; the rest of the solution needs to be implemented in upstart +
invoke-rc.d.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>