| 1 | #!/bin/sh |
| 2 | |
| 3 | ### BEGIN INIT INFO |
| 4 | # Provides: xorg-sentry |
| 5 | # Required-Start: $local_fs $remote_fs $network $syslog |
| 6 | # Required-Stop: $local_fs $remote_fs $network $syslog |
| 7 | # Default-Start: 2 3 4 5 |
| 8 | # Default-Stop: 0 1 6 |
| 9 | # Short-Description: starts the xorg-sentry server |
| 10 | # Description: starts xorg-sentry using start-stop-daemon |
| 11 | ### END INIT INFO |
| 12 | |
| 13 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
| 14 | DAEMON=/home/web/sentry/bin/xorg-sentry |
| 15 | NAME=xorg-sentry |
| 16 | DESC=xorg-sentry |
| 17 | USER=web |
| 18 | |
| 19 | # Include xorg-sentry defaults if available |
| 20 | if [ -f /etc/default/xorg-sentry ]; then |
| 21 | . /etc/default/xorg-sentry |
| 22 | fi |
| 23 | |
| 24 | test -x $DAEMON || exit 0 |
| 25 | |
| 26 | set -e |
| 27 | |
| 28 | . /lib/lsb/init-functions |
| 29 | |
| 30 | case "$1" in |
| 31 | start) |
| 32 | echo -n "Starting $DESC: " |
| 33 | start-stop-daemon --start --chuid $USER --quiet --pidfile /var/run/$NAME.pid \ |
| 34 | --background --exec $DAEMON -- start $DAEMON_OPTS || true |
| 35 | echo "$NAME." |
| 36 | ;; |
| 37 | |
| 38 | stop) |
| 39 | echo -n "Stopping $DESC: " |
| 40 | start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ |
| 41 | --exec $DAEMON || true |
| 42 | echo "$NAME." |
| 43 | ;; |
| 44 | |
| 45 | restart|force-reload) |
| 46 | echo -n "Restarting $DESC: " |
| 47 | start-stop-daemon --stop --quiet --pidfile \ |
| 48 | /var/run/$NAME.pid --exec $DAEMON || true |
| 49 | sleep 1 |
| 50 | start-stop-daemon --start --chuid $USER --quiet --pidfile \ |
| 51 | /var/run/$NAME.pid --background --exec $DAEMON -- $DAEMON_OPTS || true |
| 52 | echo "$NAME." |
| 53 | ;; |
| 54 | |
| 55 | status) |
| 56 | status_of_proc -p /var/run/$NAME.pid "$DAEMON" xorg-sentry && exit 0 || exit $? |
| 57 | ;; |
| 58 | *) |
| 59 | echo "Usage: $NAME {start|stop|restart|force-reload|status}" >&2 |
| 60 | exit 1 |
| 61 | ;; |
| 62 | esac |
| 63 | |
| 64 | exit 0 |