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

Re: Bug#370471: use of "invoke-rc.d $PACKAGE stop || exit $?" in prerm scripts



On Mon, 26 Jun 2006, Gerrit Pape wrote:
> Instead of writing their pid to a file, daemons could maintain a fifo
> and read (one-byte) commands from there; if there's no reader on the
> fifo, the daemon isn't running and nothing bad happens.

Agreed.

> Or better yet, instead of duplicating such code in each and every
> daemon, as already done for fork/exec, detach from terminal, cleanup
> filedescriptors, setsid(), write pid file, remove all that duplicated
> code, and have the service daemon run under a parent supervisor process
> which maintains such a fifo.  The parent process always already knows
> the pid to send signals to, and knows about a service daemon terminating
> through SIGCHLD.

Nothing against it, but it is sort of a war uphill (one Debian can actually
take, I suppose.  It is technically superior and it does offer a truckload
of advantages) to get all services to run in foreground mode *while* making
sure this means they behave exactly as they would be in background mode.

At least this approach makes everything from babysiting services and getting
their status, to parallel-execution and logging MUCH easier to implement.

Gerrit, I don't recall it completely, do your system provide a generalized
*per service* supervisor for initscripts, or a single master hipervisor that
is parent to all services?

Any chances of providing an sysv-init-like interface for this (I don't see
why it would be technically impossible to do it -- it is a bit more complex,
though), or do we have to insist on changing to a new initscript system type
completely?

-- 
  "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



Reply to: