Updated copyright year
[freeradius.git] / scripts / radwatch.in
index f9ede9c..854324b 100755 (executable)
@@ -4,6 +4,14 @@
 #              restarts radiusd when it dies [which ofcourse
 #              never happens :)]
 #
+#   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$
 #
 
@@ -12,7 +20,7 @@ exec_prefix=@exec_prefix@
 sbindir=@sbindir@
 localstatedir=@localstatedir@
 logdir=@logdir@
-rundir=${localstatedir}/run
+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.."