root / debian / init.d @ eafd0e30
History | View | Annotate | Download (1.3 kB)
1 |
#!/bin/sh |
---|---|
2 |
|
3 |
### BEGIN INIT INFO |
4 |
# Provides: vncauthproxy |
5 |
# Required-Start: $remote_fs $syslog $network |
6 |
# Required-Stop: $remote_fs $syslog |
7 |
# Should-Start: |
8 |
# Should-Stop: |
9 |
# Default-Start: 2 3 4 5 |
10 |
# Default-Stop: 0 1 6 |
11 |
# Short-Description: VNC authentication proxy |
12 |
# Description: VNC authentication proxy |
13 |
### END INIT INFO |
14 |
|
15 |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
16 |
DAEMON=/usr/sbin/vncauthproxy |
17 |
NAME="vncauthproxy" |
18 |
DESC="VNC authentication proxy" |
19 |
PIDFILE=/var/run/$NAME/$NAME.pid |
20 |
|
21 |
. /lib/lsb/init-functions |
22 |
|
23 |
test -x $DAEMON || exit 0 |
24 |
|
25 |
DAEMON_OPTS="--pid-file=$PIDFILE" |
26 |
|
27 |
case "$1" in |
28 |
start) |
29 |
if pidofproc -p $PIDFILE $DAEMON > /dev/null; then |
30 |
log_failure_msg "Starting $DESC (already started)" |
31 |
exit 0 |
32 |
fi |
33 |
log_daemon_msg "Starting $DESC" "$NAME" |
34 |
start-stop-daemon --start --quiet --pidfile $PIDFILE \ |
35 |
--exec $DAEMON -- $DAEMON_OPTS |
36 |
log_end_msg $? |
37 |
;; |
38 |
stop) |
39 |
log_daemon_msg "Stopping $DESC" "$NAME" |
40 |
start-stop-daemon --stop --quiet --pidfile $PIDFILE |
41 |
case "$?" in |
42 |
0) log_end_msg 0 ;; |
43 |
1) log_progress_msg "(already stopped)" |
44 |
log_end_msg 0 ;; |
45 |
*) log_end_msg 1 ;; |
46 |
esac |
47 |
;; |
48 |
force-reload|restart) |
49 |
$0 stop |
50 |
$0 start |
51 |
;; |
52 |
status) |
53 |
status_of_proc -p $PIDFILE $BIN $NAME && exit 0 || exit $? |
54 |
;; |
55 |
*) |
56 |
echo "Usage: ${0} {start|stop|restart|force-reload|status}" >&2 |
57 |
exit 1 |
58 |
;; |
59 |
esac |