[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 Sun, 10 Sep 2000, Herbert Xu wrote:
> Brendan O'Dea <bod@debian.org> wrote:
> >
> > This unfortunately doesn't work if you are trying to kill the previous
> > version of a daemon in the postinst of a package, as the binary will
> > have changed.
> 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.

BTW, on an unrelated note, a ps | grep solution *MUST* deal with the
following possible scenarios, and have ZERO error rate (otherwise you'll be
sending SIGTERM/SIGKILL to the wrong process, as root. This is simply

  1. Swapped out daemons
  2. Multiple instances of daemon (and you want to kill all, not just the
     first one -- this is common)
  3. Multiple instances of daemon (and you want to kill only the one you
     started -- never seen anyone need this, though, as daemons like apache
     have better ways to detect the right daemon to kill... so _maybe_ this
     special case can be ignored)
  4. Other processes in the ps listing which contains "daemon" as a substring,
     e.g.: a vi /etc/daemon, or a daemon substring in another program name or

I haven't read the pidof code, but I will assume it can handle all of the
above. If it doesn't, pidof needs to be fixed.

  "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: pgpY4vIO93oOY.pgp
Description: PGP signature

Reply to: