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
8 # Short-Description: Invirt remctl configuration filesystem
12 # Author: Invirt project <invirt@mit.edu>
16 # PATH should only include /usr/* if it runs after the mountnfs.sh script
17 PATH=/sbin:/usr/sbin:/bin:/usr/bin
18 DESC="the Invirt remctl configuration filesystem"
20 DAEMON=/usr/sbin/invirt-remconffs
21 DAEMON_ARGS="/etc/remctl/remconffs"
22 PIDFILE=/var/run/$NAME.pid
23 SCRIPTNAME=/etc/init.d/$NAME
25 # Exit if the package is not installed
26 [ -x "$DAEMON" ] || exit 0
28 # Read configuration variable file if it is present
29 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
31 # Load the VERBOSE setting and other rcS variables
34 # Define LSB log_* functions.
35 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
36 . /lib/lsb/init-functions
40 for i in /etc/remctl/acl/web; do
41 mako-render $i.mako > $i
46 # Function that starts the daemon/service
51 # 0 if daemon has been started
52 # 1 if daemon was already running
53 # 2 if daemon could not be started
56 daemon --running -n $NAME && return 1
57 daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
61 # Function that stops the daemon/service
66 # 0 if daemon has been stopped
67 # 1 if daemon was already stopped
68 # 2 if daemon could not be stopped
69 # other if a failure occurred
70 daemon --stop -n $NAME
72 [ "$RETVAL" = 2 ] && return 2
73 # Many daemons don't delete their pidfiles when they exit.
81 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
84 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
85 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
89 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
92 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
93 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
98 # If do_reload() is not implemented then leave this commented out
99 # and leave 'force-reload' as an alias for 'restart'.
101 #log_daemon_msg "Reloading $DESC" "$NAME"
105 restart|force-reload)
107 # If the "reload" option is implemented then remove the
108 # 'force-reload' alias
110 log_daemon_msg "Restarting $DESC" "$NAME"
117 1) log_end_msg 1 ;; # Old process is still running
118 *) log_end_msg 1 ;; # Failed to start
128 #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
129 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2