[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: fix for daemon start on package install/upgrade out-of-runlevel



On Mon, 11 Sep 2000, Herbert Xu wrote:
> On Sun, Sep 10, 2000 at 09:19:10AM -0300, Henrique M Holschuh wrote:
> > On Sun, 10 Sep 2000, Herbert Xu wrote:
> >
> > > Which is why it should only be killed in prerm/preinst.
> > 
> > Which makes all the supposed simple "restart" solution for the runlevel
> > problem fail in _all_ cases. Thank you for reminding me of the prerm issue,
> > nearly all daemon-providing packages stop the daemon in prerm. All of these
> > packages would have to stop doing this (at least on upgrades) for a
> > "restart" solution to the "runlevel" problem to work.
> 
> Huh? If what you want is an "only start this in runlevel X,Y,Z", then this
> certainly can be done with stopping the daemon in prerm, and restarting it
> in postinst if we're in the correct runlevel.

Hmm, we have a communications breakdown here :-)

What I mean is:

1. using a initscriptquery-type strategy, you CAN safely stop the daemon
   wherever you whish, including in prerm. The daemon will be started again
   (which I don't call "restarted" :-) -- I reserve that for "stop a running
   daemon and start it again immediactly") if you're in the correct
   runlevel.

and 

2. If you're going to use 'pidof'/ps/grep-style strategies to detect if
   you're in the current runlevel, it won't work correctly always. Also, it
   will fail if you stop the daemon in the prerm (and in other circunstances
   as well).

Therefore, 

3. initscriptquery-type strategies are better, as they allow you to keep
   stopping your daemons in prerm.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

Attachment: pgpo0qFSTQj8z.pgp
Description: PGP signature


Reply to: