3 # Provides: sipb-xen-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: conserver config from invirt config for invirt host
12 # Author: Invirt/XVM Project, MIT SIPB <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="Invirt host console config"
19 NAME=sipb-xen-console-server
20 SCRIPTNAME=/etc/init.d/$NAME
22 # Read configuration variable file if it is present
23 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
25 # Load the VERBOSE setting and other rcS variables
28 # Define LSB log_* functions.
29 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
30 . /lib/lsb/init-functions
34 for i in /etc/conserver/invirt-genconfig.cf
35 do mako-render $i.mako > $i
40 # Function that starts the daemon/service
45 # 0 if daemon has been started
46 # 1 if daemon was already running
47 # 2 if daemon could not be started
49 VERBOSE=no /etc/init.d/conserver-server reload
53 # Function that stops the daemon/service
63 VERBOSE=no /etc/init.d/conserver-server reload
68 [ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
71 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
72 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
76 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
79 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
80 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
84 log_daemon_msg "Reloading $DESC" "$NAME"
89 log_daemon_msg "Restarting $DESC" "$NAME"
96 1) log_end_msg 1 ;; # Old process is still running
97 *) log_end_msg 1 ;; # Failed to start
107 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2