root/debian/openxcap.init

Revision 449, 1.4 kB (checked in by Denis Bilenko <denis@ag-projects.com>, 5 weeks ago)

separate error message with a space

Line 
1#!/bin/sh
2#
3### BEGIN INIT INFO
4# Provides:          openxcap
5# Required-Start:    $syslog $network $local_fs $time
6# Required-Stop:     $syslog $network $local_fs
7# Default-Start:     2 3 4 5
8# Default-Stop:      0 1 6
9# Short-Description: Start the OpenXCAP server
10# Description:       Start the OpenXCAP server
11### END INIT INFO
12
13PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
14
15INSTALL_DIR="/usr/bin"
16RUNTIME_DIR="/var/run/openxcap"
17
18SERVER="$INSTALL_DIR/openxcap"
19PID="$RUNTIME_DIR/openxcap.pid"
20
21# Options for the OpenXCAP server. Do not include --pid <pidfile>
22# --pid <pidfile> will be added automatically if needed.
23OPTIONS=""
24
25NAME="openxcap"
26DESC="OpenXCAP server"
27
28test -f $SERVER || exit 0
29
30if [ "$PID" != "/var/run/openxcap/openxcap.pid" ]; then
31    OPTIONS="--pid $PID $OPTIONS"
32fi
33
34start() {
35    echo -n "Starting $DESC: $NAME "
36    start-stop-daemon --start --quiet --pidfile $PID --exec $SERVER -- $OPTIONS
37    echo "."
38}
39
40stop () {
41    echo -n "Stopping $DESC: $NAME "
42    start-stop-daemon --stop --quiet --oknodo --signal 15 --pidfile $PID
43    echo "."
44}
45
46case "$1" in
47    start)
48        start
49        ;;
50    stop)
51        stop
52        ;;
53    restart|force-reload)
54        stop
55        #sleep 1
56        start
57        ;;
58    *)
59        echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
60        exit 1
61        ;;
62esac
63
64exit 0
Note: See TracBrowser for help on using the browser.