tracd debian init script
This is /etc/init.d/tracd
#! /bin/sh # # tracd Trac standalone server daemon # # Author: cocoaberry # set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="Trac standalone server" NAME=tracd DAEMON=/usr/bin/$NAME PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 # defaults for tracd TRACD_PORT=8080 TRACD_BIND_ADDRESS=0.0.0.0 TRACD_EXTRA_OPTS= # Read config file if it is present. if [ -r /etc/default/$NAME ] then . /etc/default/$NAME fi # # Function that starts the daemon/service. # d_start() { start-stop-daemon --start --background --make-pidfile --quiet \ --pidfile $PIDFILE --chuid $TRACD_USER \ --exec $DAEMON -- $TRACD_EXTRA_OPTS --port $TRACD_PORT --hostname $TRACD_BIND_ADDRESS $TRACD_ENVIRONMENTS } # # Function that stops the daemon/service. # d_stop() { start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \ --name $NAME } case "$1" in start) echo -n "Starting $DESC: $NAME" d_start echo "." ;; stop) echo -n "Stopping $DESC: $NAME" d_stop echo "." ;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # echo -n "Restarting $DESC: $NAME" d_stop sleep 1 d_start echo "." ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0
This is /etc/default/tracd
# Default settings for tracd. This file is sourced by # /etc/init.d/tracd # MAJOR HACK - disable globbing so $TRACD_EXTRA_OPTS on cmdline won't expand # the * set -f # The user that tracd runs as TRACD_USER=tracd # The environments that tracd manages. If more than one, separate # with spaces TRACD_ENVIRONMENTS=/home/tracd/trac-env # Extra options to tracd TRACD_EXTRA_OPTS="--auth *,/home/tracd/trac.htdigest,TracRealm" # The port that tracd binds to. The default is 8080 # TRACD_PORT=8080 # The addresses that tracd binds to. The default is 0.0.0.0 # TRACD_BIND_ADDRESS=0.0.0.0