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

Last change on this file since 1660 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
RevLine 
[525]1#! /bin/sh
2### BEGIN INIT INFO
[1176]3# Provides:          invirt-remote-server
[525]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
[1176]8# Short-Description: Invirt remctl configuration filesystem
[525]9# Description:       
10### END INIT INFO
11
[1224]12# Author: Invirt project <invirt@mit.edu>
[525]13
14PATH=/sbin:/usr/sbin:/bin:/usr/bin
[1534]15NAME=invirt-remote-server
[1176]16DESC="the Invirt remctl configuration filesystem"
17DAEMON=/usr/sbin/invirt-remconffs
[525]18DAEMON_ARGS="/etc/remctl/remconffs"
19PIDFILE=/var/run/$NAME.pid
20SCRIPTNAME=/etc/init.d/$NAME
[1534]21GEN_FILES=/etc/remctl/acl/web
[525]22
23# Exit if the package is not installed
24[ -x "$DAEMON" ] || exit 0
25
[1534]26. /lib/init/gen-files.sh
27. /lib/init/std-init.sh
[525]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
[1534]35        gen_files
[525]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
[1534]57std_init "$1"
Note: See TracBrowser for help on using the repository browser.