3 # radwatch Script to watch RADIUS. Sends mail to root and
4 # restarts radiusd when it dies [which ofcourse
7 # WARNING! This script SHOULD NOT BE USED! It's only here for historical
8 # purposes, and WILL be deleted in a future version of the
11 # If you want to watch and re-start the server, we recommend
12 # reading the file doc/supervise-radiusd.txt
19 exec_prefix=@exec_prefix@
21 localstatedir=@localstatedir@
23 rundir=${localstatedir}/run/radiusd
26 RADIUSD=$sbindir/radiusd
28 exec >> $logdir/radwatch.log 2>&1
30 # get the path to the radiusd
31 if [ "$1" ] && [ -x "$1" ]
38 [ -d $logdir/radacct ] && cd $logdir/radacct
42 trap 'echo `date`: exit; kill `cat $rundir/radiusd.pid`; exit 0' TERM
47 # Use `wait', otherwise the trap doesn't work.
49 echo "$!" > $rundir/radiusd.pid
51 exec >> $logdir/radwatch.log 2>&1
52 echo "`date`: Radius died, restarting.."
53 date | mail -s "Radius died, restarting.." $MAILTO
58 echo "$!" > $rundir/radwatch.pid