lua-users home
lua-l archive

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

Sean Conner wrote:

> Ideally, a control channel would be used between the inetd-type
> program and the daemons (possibly over stdin/stdout?) so that commands
> can be given to the inetd-type program to manage the daemons, but that
> requires daemons written to support such a channel (and modifications
> to the inetd-type program as well); it's something I'd like to add,
> but don't have a pressing need to yet.

You might want to look at runit[1], s6[2] or the daemontools[3], which
implement managing what they call "services".  A supervisor sends
signals to a service.  If the services directory structure has
a subdirectory called ./log, the "run" program in it, which often is
a regular shell script, execs into a logger.  The supervisor sets up
a pipe from the services stdout to the loggers stdin and tries its best
to keep it even when either the service or the logger crashes.  The
supervisor also restarts programs after a crash.

These systems can be used as unix process 1 ("init") and they don't need
dependency checking.  If some service needs another one early, it will
crash, of course, but it will get restarted.  As long as the dependency
graph contains no cycles, the system stabilizes pretty fast.  S6
implements a notifier which can be used for dependency tracking.  Runit
implements "guarding" scripts which can be used for housekeeping.