Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
3 total  XML / RSS feed 

tracd debian init script

tracd init script on debian stable. consists of two parts, /etc/init.d/tracd and /etc/default/tracd

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

Trac: Running the Standalone Server

Running the Standalone Server
-----------------------------
After having created a Trac environment, you can easily try the web interface
by running the standalone server tracd:
  $ tracd --port 8000 /path/to/projectenv

Then, fire up a browser and visit http://localhost:8000/. You should get a
simple listing of all environments that tracd knows about. Follow the link
to the environment you just created, and you should see Trac in action.

Lighttpd proxy with Tracd specific example

$HTTP["host"] == "trac.textdrive.com" #the == is to exactly match
{
proxy.server = (
"" => (                               #this is for the root, can be a .extension in other uses
"trac" => (                           #just a name, your choice
"host" => "70.84.29.150", 
"port" => 9000 
           )
       )
                )
}
« Newer Snippets
Older Snippets »
3 total  XML / RSS feed