source: trunk/packages/invirt-vnc-server/debian/invirt-vnc-server.init @ 1926

Last change on this file since 1926 was 1407, checked in by broder, 16 years ago

Fix a typo in invirt-vnc-server's init script

File size: 1.4 KB
Line 
1#! /bin/sh
2### BEGIN INIT INFO
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
7# Default-Stop:      0 1 6
8# Short-Description: Invirt VNC Proxy Server
9# Description:       
10### END INIT INFO
11
12# Author: Invirt project <invirt@mit.edu>
13
14# Do NOT "set -e"
15
16# PATH should only include /usr/* if it runs after the mountnfs.sh script
17PACKAGE=invirt-vnc-server
18DESC="The Invirt VNC Proxy Server"
19DAEMON=/usr/sbin/invirt-vnc-server
20DAEMON_ARGS=""
21PIDFILE=/var/run/$PACKAGE.pid
22SCRIPTNAME=/etc/init.d/$PACKAGE
23
24# Exit if the package is not installed
25[ -x "$DAEMON" ] || exit 0
26
27. /lib/init/std-init.sh
28
29#
30# Function that starts the daemon/service
31#
32do_start()
33{
34        # Return
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 $PACKAGE && return 1
39        daemon -r -U -O daemon.info -E daemon.err -n $PACKAGE -U $DAEMON $DAEMON_ARGS || return 2
40}
41
42#
43# Function that stops the daemon/service
44#
45do_stop()
46{
47        # Return
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 $PACKAGE
53        RETVAL="$?"
54        [ "$RETVAL" = 2 ] && return 2
55        # Many daemons don't delete their pidfiles when they exit.
56        rm -f $PIDFILE
57        return "$RETVAL"
58}
59
60std_init "$1"
Note: See TracBrowser for help on using the repository browser.