import from HEAD:
[freeradius.git] / scripts / radwatch.in
index e261313..854324b 100755 (executable)
@@ -4,15 +4,23 @@
 #              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
@@ -38,6 +46,7 @@ ulimit -c unlimited
        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.."