Skip to main content

Daemon Tools

Hi Dave

Finally got the daemontools on netmon01 to supervise radiusd, and it should restart if the computer is restarted.

netmon01# cd /service/radiusd/
netmon01# ls
env/            run*        supervise/
netmon01# cat run
#!/bin/sh
echo "Starting FreeRadius"
logger FreeRadius starting
exec /usr/local/bin/envdir ./env /usr/local/sbin/radiusd -d /etc/raddb -f

netmon01# cd env
/service/radiusd/env
netmon01# ls
LD_LIBRARY_PATH       localstatedir     logdir              rundir          supervise/

netmon01# ls
LD_LIBRARY_PATH       localstatedir     logdir              rundir          supervise/
netmon01# for i in * ; do
 echo $i
 cat $i
 echo
 done
LD_LIBRARY_PATH
/lib:/usr/lib:/usr/local/lib

localstatedir
/var

logdir
/var/log/radius

rundir
/var/run/radiusd

netmon01# cd /etc/init.d
netmon01# cat daemontools
#!/bin/sh

# quickie startup script for djb's DaemonTools

/usr/local/bin/svscan /service &

Apart from the fact that running svscan means that you can't detatch from your ssh connection (svscan holds on to the session and the ssh session must be killed at the originating side), this appears to work properly.

I'm not particularly sold on it as a daemon management system, but it might grow on me.