source: configuration/trac/tracd @ 1414:90d39a446bbc

Revision 1414:90d39a446bbc, 1.7 KB checked in by niam, 2 years ago (diff)

trac standalone configuration

Line 
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides:          trac
4# Required-Start:    $syslog $network
5# Required-Stop:     $syslog $network
6# Default-Start:     2 3 4 5
7# Default-Stop:      0 1 6
8# Short-Description: Start the trac server.
9# Author:            cocoaberry, niam
10### END INIT INFO
11
12set -e
13
14PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15DESC="Trac standalone server"
16NAME=tracd
17DAEMON=/usr/bin/$NAME
18PIDFILE=/var/run/$NAME.pid
19SCRIPTNAME=/etc/init.d/$NAME
20
21# Gracefully exit if the package has been removed.
22test -x $DAEMON || exit 0
23
24# defaults for tracd
25TRACD_PORT=9000
26TRACD_BIND_ADDRESS=127.0.01
27TRACD_ENVIRONMENTS=
28TRACD_EXTRA_OPTS=-s
29TRACD_USER=
30
31# Read config file if it is present.
32if [ -r /etc/default/$NAME ]
33then
34        . /etc/default/$NAME
35fi
36
37#
38#       Function that starts the daemon/service.
39#
40d_start() {
41        start-stop-daemon --start --background --make-pidfile --quiet \
42                --pidfile $PIDFILE --chuid $TRACD_USER \
43                --exec $DAEMON -- $TRACD_EXTRA_OPTS --port $TRACD_PORT --hostname $TRACD_BIND_ADDRESS $TRACD_ENVIRONMENTS
44}
45
46#
47#       Function that stops the daemon/service.
48#
49d_stop() {
50        start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
51                --name $NAME
52}
53
54case "$1" in
55  start)
56        echo -n "Starting $DESC: $NAME"
57        d_start
58        echo "."
59        ;;
60  stop)
61        echo -n "Stopping $DESC: $NAME"
62        d_stop
63        echo "."
64        ;;
65  restart|force-reload)
66        #
67        #       If the "reload" option is implemented, move the "force-reload"
68        #       option to the "reload" entry above. If not, "force-reload" is
69        #       just the same as "restart".
70        #
71        echo -n "Restarting $DESC: $NAME"
72        d_stop
73        sleep 1
74        d_start
75        echo "."
76        ;;
77  *)
78        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
79        exit 1
80        ;;
81esac
82
83exit 0
84
Note: See TracBrowser for help on using the repository browser.