source: trunk/packages/invirt-remote-server/debian/invirt-remote-server.init @ 1669

Last change on this file since 1669 was 1534, checked in by price, 16 years ago

shorten invirt-remote-server initscript with std-init, correct the usage message

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides:          invirt-remote-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 remctl configuration filesystem
9# Description:       
10### END INIT INFO
11
12# Author: Invirt project <invirt@mit.edu>
13
14PATH=/sbin:/usr/sbin:/bin:/usr/bin
15NAME=invirt-remote-server
16DESC="the Invirt remctl configuration filesystem"
17DAEMON=/usr/sbin/invirt-remconffs
18DAEMON_ARGS="/etc/remctl/remconffs"
19PIDFILE=/var/run/$NAME.pid
20SCRIPTNAME=/etc/init.d/$NAME
21GEN_FILES=/etc/remctl/acl/web
22
23# Exit if the package is not installed
24[ -x "$DAEMON" ] || exit 0
25
26. /lib/init/gen-files.sh
27. /lib/init/std-init.sh
28
29do_start()
30{
31        # Return
32        #   0 if daemon has been started
33        #   1 if daemon was already running
34        #   2 if daemon could not be started
35        gen_files
36        modprobe fuse
37        daemon --running -n $NAME && return 1
38        daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
39}
40
41do_stop()
42{
43        # Return
44        #   0 if daemon has been stopped
45        #   1 if daemon was already stopped
46        #   2 if daemon could not be stopped
47        #   other if a failure occurred
48        daemon --stop -n $NAME
49        RETVAL="$?"
50        [ "$RETVAL" = 2 ] && return 2
51        # Many daemons don't delete their pidfiles when they exit.
52        rm -f $PIDFILE
53        umount "$DAEMON_ARGS"
54        return "$RETVAL"
55}
56
57std_init "$1"
Note: See TracBrowser for help on using the repository browser.