3 # Provides: invirt-console-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 console proxy server
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 console server"
19 NAME=invirt-console-server
20 DAEMON=/usr/bin/invirt-consolefs
21 MOUNTPOINT="/consolefs"
22 DAEMON_ARGS="-f $MOUNTPOINT"
23 PIDFILE=/var/run/$NAME.pid
24 SCRIPTNAME=/etc/init.d/$NAME
26 # Exit if the package is not installed
27 [ -x "$DAEMON" ] || exit 0
29 . /lib/init/std-init.sh
33 for i in /etc/conserver/invirt-hosts.cf \
34 /etc/remctl/acl/invirt-console-server \
35 /etc/issue.net.no_tkt \
38 mako-render $i.mako > $i
43 # Function that starts the daemon/service
48 # 0 if daemon has been started
49 # 1 if daemon was already running
50 # 2 if daemon could not be started
52 # Try to make sure fuse is setup
53 [ -e /dev/fuse ] || modprobe fuse || return 2
55 if cat /proc/mounts | grep " $MOUNTPOINT " >/dev/null 2>&1; then
61 daemon -r -O daemon.info -E daemon.err -n $NAME -- $DAEMON $DAEMON_ARGS || return 2
65 # Function that stops the daemon/service
70 # 0 if daemon has been stopped
71 # 1 if daemon was already stopped
72 # 2 if daemon could not be stopped
73 # other if a failure occurred
75 if ! cat /proc/mounts | grep " $MOUNTPOINT " >/dev/null 2>&1; then
79 daemon --stop -n $NAME
81 [ "$RETVAL" = 2 ] && return 2
82 # Many daemons don't delete their pidfiles when they exit.
89 invoke-rc.d conserver-server reload