|
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 | |
|---|
| 13 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
|---|
| 14 | |
|---|
| 15 | INSTALL_DIR="/usr/bin" |
|---|
| 16 | RUNTIME_DIR="/var/run/openxcap" |
|---|
| 17 | |
|---|
| 18 | SERVER="$INSTALL_DIR/openxcap" |
|---|
| 19 | PID="$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. |
|---|
| 23 | OPTIONS="" |
|---|
| 24 | |
|---|
| 25 | NAME="openxcap" |
|---|
| 26 | DESC="OpenXCAP server" |
|---|
| 27 | |
|---|
| 28 | test -f $SERVER || exit 0 |
|---|
| 29 | |
|---|
| 30 | if [ "$PID" != "/var/run/openxcap/openxcap.pid" ]; then |
|---|
| 31 | OPTIONS="--pid $PID $OPTIONS" |
|---|
| 32 | fi |
|---|
| 33 | |
|---|
| 34 | start() { |
|---|
| 35 | echo -n "Starting $DESC: $NAME " |
|---|
| 36 | start-stop-daemon --start --quiet --pidfile $PID --exec $SERVER -- $OPTIONS |
|---|
| 37 | echo "." |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | stop () { |
|---|
| 41 | echo -n "Stopping $DESC: $NAME " |
|---|
| 42 | start-stop-daemon --stop --quiet --oknodo --signal 15 --pidfile $PID |
|---|
| 43 | echo "." |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | case "$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 | ;; |
|---|
| 62 | esac |
|---|
| 63 | |
|---|
| 64 | exit 0 |
|---|