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>
14 PATH=/sbin:/usr/sbin:/bin:/usr/bin
15 NAME=invirt-remote-server
16 DESC="the Invirt remctl configuration filesystem"
17 DAEMON=/usr/sbin/invirt-remconffs
18 MOUNTPOINT="/etc/remctl/remconffs"
19 DAEMON_ARGS="-f $MOUNTPOINT"
20 PIDFILE=/var/run/$NAME.pid
21 SCRIPTNAME=/etc/init.d/$NAME
22 GEN_FILES=/etc/remctl/acl/web
24 # Exit if the package is not installed
25 [ -x "$DAEMON" ] || exit 0
27 . /lib/init/gen-files.sh
28 . /lib/init/std-init.sh
31 # Function that starts the daemon/service
36 # 0 if daemon has been started
37 # 1 if daemon was already running
38 # 2 if daemon could not be started
40 # Try to make sure fuse is setup
41 [ -e /dev/fuse ] || modprobe fuse || return 2
43 if cat /proc/mounts | grep " $MOUNTPOINT " >/dev/null 2>&1; then
49 daemon -r -O daemon.info -E daemon.err -n $NAME -- $DAEMON $DAEMON_ARGS || return 2
53 # Function that stops the daemon/service
58 # 0 if daemon has been stopped
59 # 1 if daemon was already stopped
60 # 2 if daemon could not be stopped
61 # other if a failure occurred
63 if ! cat /proc/mounts | grep " $MOUNTPOINT " >/dev/null 2>&1; then
67 daemon --stop -n $NAME
69 [ "$RETVAL" = 2 ] && return 2
70 # Many daemons don't delete their pidfiles when they exit.