#!/bin/sh ### BEGIN INIT INFO # Provides: tracd # Required-Start: $network # Required-Stop: # Default-Start: 2 3 5 # Default-Stop: 0 1 6 # Description: Start the Trac webservice ### END INIT INFO # Set global variables LOGDIR=/var/log/trac TRAC=/usr/bin/tracd PORT=8000 # Check to see if executable "bttrack" # is presented. If not then exit with a # none-zero status test -x $TRAC || exit 5 # Check to see if log directories # are there. If not then make them test -d $LOGDIR || mkdir -p $LOGDIR # Include the status script and # clear its status . /etc/rc.status rc_reset case "$1" in start) echo -n "Starting trac webservice" startproc $TRAC -p $PORT --auth *,/srv/trac/users.htdigest, -e /srv/trac >>$LOGDIR/trac.log 2>>$LOGDIR/trac.log rc_status -v ;; stop) echo -n "Stopping trac webservice" killproc -TERM $TRAC rc_status -v ;; restart) $0 stop $0 start rc_status ;; status) echo -n "Checking status of trac: " checkproc $TRAC rc_status -v ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac