| 1 | Here is a simple script to start bitten-slave as a daemon. This will usually be put in /etc/init.d or wherever your init scripts are kept. This has been tested on Ubuntu Hardy, however should run from any system with only minimal changes. You will need to change the DAEMON_ARG varible to contain a URL which reflects your server. |
| 2 | |
| 3 | |
| 4 | {{{ |
| 5 | #! /bin/sh |
| 6 | ### BEGIN INIT INFO |
| 7 | # Provides: bitten-slave |
| 8 | # required-start: $all |
| 9 | # required-stop: $all |
| 10 | # Default-Start: 2 3 4 5 |
| 11 | # Default-Stop: 0 1 6 |
| 12 | # Short-Description: starts trac's bitten-slave |
| 13 | # Description: starts trac's bitten-slave using start-stop-daemon |
| 14 | ### END INIT INFO |
| 15 | |
| 16 | NAME="bitten-slave" |
| 17 | DAEMON_CMD="/usr/bin/bitten-slave" |
| 18 | DAEMON_ARG="http://localhost/staff/trac/sistema/builds -i 15 -umarcos -pmpbe897" |
| 19 | |
| 20 | test -x $DAEMON_CMD || exit 0 |
| 21 | |
| 22 | set -e |
| 23 | |
| 24 | case "$1" in |
| 25 | start) |
| 26 | echo -n "Arrancando bitten-slave" |
| 27 | start-stop-daemon --start -m --quiet --background --pidfile /var/run/bitten-slave.pid --exec $DAEMON_CMD -- $DAEMON_ARG |
| 28 | ;; |
| 29 | stop) |
| 30 | echo -n "Parando bitten-slave" |
| 31 | start-stop-daemon --stop --quiet --pidfile /var/run/bitten-slave.pid --oknodo |
| 32 | ;; |
| 33 | *) |
| 34 | N=/etc/init.d/$NAME |
| 35 | echo "Uso: $N {start|stop}" >&2 |
| 36 | exit 1 |
| 37 | ;; |
| 38 | esac |
| 39 | |
| 40 | exit 0 |
| 41 | }}} |