X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vsys-initscript;h=cfeba9a84f8ac93a62641c1b1d003306a0ef130d;hb=755411474ed0a694766fc6f3a916afaee1da7ebd;hp=5ade7506dde9bc52d26230ef88df1fd7507fe563;hpb=6e043af83191e7ca7b456c999e5c3abd67530fbb;p=vsys.git diff --git a/vsys-initscript b/vsys-initscript index 5ade750..cfeba9a 100755 --- a/vsys-initscript +++ b/vsys-initscript @@ -1,16 +1,56 @@ #!/bin/bash +# +# chkconfig: 345 84 02 +# description: Vsys file descriptor abritrator startup. +# +# Sapan Bhatia +# +# $Id$ +# $HeadURL$ +# +name="vsys" + +# Source function library. +. /etc/rc.d/init.d/functions + +if [ -f /etc/sysconfig/$name ]; then + . /etc/sysconfig/$name +fi + +backend=${BACKEND-/vsys} + +conf=${CONF-/etc/$name.conf} +pidfile=${PIDFILE-/var/run/$name.pid} +lockfile=${LOCKFILE-/var/lock/subsys/$name} +RETVAL=0 + +vsys=${VSYS- "/usr/bin/vsys -failsafe -backend $backend -conffile $conf -daemon"} case "$1" in - start|restart|reload|update) - ;; - stop|status) - exit 0 - ;; + start) + echo -n "Starting $name:" + if [ ! -d $backend ]; then mkdir $backend; fi + daemon --check=vsys $vsys + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch ${lockfile} + ;; + stop) + echo -n "Stopping $name:" + killproc $name + #killproc $name - Why were there 2 instances of this? :-| + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f ${lockfile} ${pidfile} + ;; + restart) + $0 stop + $0 start + RETVAL=$? + ;; *) - echo $"Usage: $0 {start|stop|restart|status}" - exit 1 - ;; + echo $"Usage: $0 {start|stop|restart}" + exit 1 + ;; esac -# Source function library. -. /etc/rc.d/init.d/functions