# restarts radiusd when it dies [which ofcourse
# never happens :)]
#
-# Version: @(#)radwatch 1.20 19-Jul-1999 miquels@cistron.nl
+# WARNING! This script SHOULD NOT BE USED! It's only here for historical
+# purposes, and WILL be deleted in a future version of the
+# the server.
+#
+# If you want to watch and re-start the server, we recommend
+# reading the file doc/supervise-radiusd.txt
+#
+#
+# Version: $Id$
#
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-sbindir = @sbindir@
-localstatedir = @localstatedir@
-logdir = @logdir@
-rundir = ${localstatedir}/run
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+sbindir=@sbindir@
+localstatedir=@localstatedir@
+logdir=@logdir@
+rundir=${localstatedir}/run/radiusd
MAILTO=root
RADIUSD=$sbindir/radiusd
do
# Use `wait', otherwise the trap doesn't work.
$RADIUSD -f $* &
+ echo "$!" > $rundir/radiusd.pid
wait
exec >> $logdir/radwatch.log 2>&1
echo "`date`: Radius died, restarting.."