#!/bin/bash ### BEGIN INIT INFO # Provides: svnwcsub # Required-Start: $remote_fs # Required-Stop: $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: SvnWcSub # Description: start SvnWcSub daemon #### END INIT INFO . /lib/init/vars.sh . /lib/lsb/init-functions svnwcsub_user=${svnwcsub_user-"svnwc"} svnwcsub_group=${svnwcsub_group-"svnwc"} svnwcsub_reactor=${svnwcsub_reactor-"poll"} svnwcsub_pidfile=${svnwcsub_pidfile-"/var/run/svnwcsub.pid"} pidfile="${svnwcsub_pidfile}" TWSITD_CMD="/usr/bin/twistd -y /opt/svnpubsub/svnwcsub.tac \ --logfile=/var/bwlog/svnpubsub/svnwcsub.log \ --pidfile=${pidfile} \ --uid=${svnwcsub_user} --gid=${svnwcsub_group} \ -r${svnwcsub_reactor}" RETVAL=0 start() { echo "Starting SvnWcSub Server: " $TWSITD_CMD RETVAL=$? [ $RETVAL -eq 0 ] && echo "ok" || echo "failed" return $RETVAL } stop() { echo "Stopping SvnWcSub Server: " THE_PID=`cat ${pidfile}` kill $THE_PID RETVAL=$? [ $RETVAL -eq 0 ] && echo "ok" || echo "failed" return $RETVAL } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit $RETVAL