3 # Provides: @PACKAGE@-plugin-scmbzr
4 # Required-Start: $local_fs $network
5 # Required-Stop: $local_fs $network
6 # Default-Start: 2 3 4 5
10 # Init script for @PACKAGE@-plugin-scmbzr Debian package.
11 # Based on the script provided by loggerhead.
13 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
14 DESC="Loggerhead Bazaar Branch Browser for @FORGENAME@"
15 NAME=@PACKAGE@-plugin-scmbzr
16 PIDFILE=/var/run/$NAME.pid
17 SCRIPTNAME=/etc/init.d/$NAME
19 # Gracefully exit if the package has been removed.
20 [ -x /usr/bin/serve-branches ] || exit 0
22 # Check if configuration file is present
23 [ ! -f /etc/@PACKAGE@/plugins/scmbzr/serve-branches.conf ] && exit 0
25 . /etc/@PACKAGE@/plugins/scmbzr/serve-branches.conf
28 # Function that starts the daemon/service.
31 start-stop-daemon -p $PIDFILE -S --startas /usr/bin/serve-branches --chuid loggerhead --make-pidfile --background --chdir $served_branches -- --prefix=$prefix --port=$port --log-folder /var/log/loggerhead 2>/dev/null
35 # Function that stops the daemon/service.
38 start-stop-daemon -p $PIDFILE -K
44 echo -n "Starting $DESC: $NAME"
49 echo -n "Stopping $DESC: $NAME"
54 echo -n "Restarting $DESC: $NAME"
61 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2