I found a few init scripts for trac, but they were all Debian-based, using ’start-stop-daemon’ which does not exist in RedHat-based distros. Here’s an init script that will work with RedHat.
#!/bin/bash
#
# tracd Start/Stop tracd.
#
# chkconfig: - 62 38
# description: tracd
#
# processname: tracd
#
# Author: Elliot (info@coastalweb.ca)
# Source function library
. /etc/init.d/functions
# Get network config
. /etc/sysconfig/network
RETVAL=0
TRACD_PORT=8000
TRACD_USER=tracd
DAEMON=/usr/bin/tracd
PIDFILE=/var/lock/subsys/tracd
TRACD_DIR=/subversion/trac
start() {
echo -n $"Starting tracd: "
daemon --user $TRACD_USER $DAEMON --port=$TRACD_PORT --daemonize \
--env-parent-dir=$TRACD_DIR
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $PIDFILE
return $RETVAL
}
stop() {
echo -n $"Stopping tracd: "
killproc tracd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $PIDFILE
return $RETVAL
}
restart() {
stop
start
}
reload() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status tracd
;;
restart)
restart
;;
condrestart)
[ -f $PIDFILE ] && restart || :
;;
reload)
reload
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
exit 1
esac
exit $?


