- Write pid file if filename is set

- Add startup script and monitor script from Yuri
- Some logging correctness fixes from Iain Wade
- Combined LCP patches from Iain and Yuri. This should allow Windows 2k/XP
  clients to connect, as well Linksys DSL modems.
This commit is contained in:
fred_nerk 2004-08-02 03:38:01 +00:00
parent 1aa6a3a96d
commit 8c861521ae
7 changed files with 185 additions and 20 deletions

28
scripts/l2tpns-monitor Normal file
View file

@ -0,0 +1,28 @@
#!/bin/sh
stopfile=/tmp/l2tpns.stop
first=`date +%s`
min_first_time=3
restart_delay=5
prog=${0##*/}
while :
do
echo "`date`: Starting l2tpns $@"
start=`date +%s`
/usr/sbin/l2tpns ${1+"$@"}
RETVAL=$?
stop=`date +%s`
t=$(($stop - $start));
first=$(($stop - $first));
echo "`date`: l2tpns exited after $t seconds, status $RETVAL"
if [ $first -lt $min_first_time ]; then
echo "`date`: l2tpns exited immediately, $prog exiting"
exit $RETVAL
fi
if [ -f $stopfile ]; then
ls -l $stopfile
echo "`date`: stop file found, $prog exiting"
exit
fi
sleep $restart_delay
done >>/var/log/$prog 2>&1 & # execute in background