3 # Provides: invirt-vnc-server
4 # Required-Start: $local_fs $remote_fs
5 # Required-Stop: $local_fs $remote_fs
6 # Default-Start: 2 3 4 5
8 # Short-Description: Invirt VNC Proxy Server
12 # Author: Invirt project <invirt@mit.edu>
16 # PATH should only include /usr/* if it runs after the mountnfs.sh script
17 PACKAGE=invirt-vnc-server
18 DESC="The Invirt VNC Proxy Server"
19 DAEMON=/usr/sbin/invirt-vnc-server
21 PIDFILE=/var/run/$NAME.pid
22 SCRIPTNAME=/etc/init.d/$NAME
24 # Exit if the package is not installed
25 [ -x "$DAEMON" ] || exit 0
27 . /lib/init/std-init.sh
30 # Function that starts the daemon/service
35 # 0 if daemon has been started
36 # 1 if daemon was already running
37 # 2 if daemon could not be started
38 daemon --running -n $NAME && return 1
39 daemon -r -U -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
43 # Function that stops the daemon/service
48 # 0 if daemon has been stopped
49 # 1 if daemon was already stopped
50 # 2 if daemon could not be stopped
51 # other if a failure occurred
52 daemon --stop -n $NAME
54 [ "$RETVAL" = 2 ] && return 2
55 # Many daemons don't delete their pidfiles when they exit.