--no-detach option?

Jos Backus josb at cncdsl.com
Thu Nov 22 09:14:08 EST 2001

On Wed, Nov 21, 2001 at 03:27:52PM -0600, Dave Dykstra wrote:
> I'm not familiar with daemontools; I checked the web site and it wasn't
> obvious to me.  What's the advantage of using daemontools supervise?  Why
> does it need to run the daemon as a subprocess?

Like AIX's SRC (System Resource Controller), svscan/supervise together with
svc/svstat are designed to control daemons in a uniform, platform-independent
way. So rather than having start|stop scripts (/etc/rc?.d/*, /etc/rc.local,
etc.) for each daemon, a service scanner (svscan) runs which starts supervise
processes, which in turn manage each individual service. By virtue of
supervise being the parent of the service being managed, problems with stale
pidfiles and such are being avoided. A simple example:

    traitor:/service% ls -l sshd
    lrwxr-xr-x  1 root  wheel  17 May  7  2001 sshd -> /var/service/sshd
    traitor:/service% ls -l /var/service/sshd
    total 3
    drwxr-xr-x  4 nobody  wheel  512 May  7  2001 log
    -rwxr-xr-x  1 root    wheel   91 May  7  2001 run
    drwx------  2 root    wheel  512 Nov 21 13:48 supervise
    traitor:/service% cat /var/service/sshd/run

    exec sshd -D -e 2>&1

The service can be controlled (up/down/restart/run once) using the svc
command. Among others, one thing this setup makes easy is for a privileged
process to be controlled by an unprivileged group of users, by simply
manipulating the permissions on the service control socket.

> Assuming it's a command to make sure a daemon keeps running, it seems to me
> that it ought to be able to work if given a process id and not require any
> deaemon it could supervise to be modified to not fork.  I have a script for
> my own use which does that.

It does more than just that. Hope this explains things a little bit.

> - Dave Dykstra

Jos Backus                 _/  _/_/_/        Santa Clara, CA
                          _/  _/   _/
                         _/  _/_/_/             
                    _/  _/  _/    _/
josb at cncdsl.com     _/_/   _/_/_/            use Std::Disclaimer;

More information about the rsync mailing list