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 console_ip=$(invirt-getconf console.ip)
35 cat >/etc/conserver/invirt-genconfig.cf <<EOF
45 # Function that starts the daemon/service
50 # 0 if daemon has been started
51 # 1 if daemon was already running
52 # 2 if daemon could not be started
54 VERBOSE=no /etc/init.d/conserver-server reload
58 # Function that stops the daemon/service
68 VERBOSE=no /etc/init.d/conserver-server reload
73 [ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
76 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
77 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
81 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
84 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
85 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
89 log_daemon_msg "Reloading $DESC" "$NAME"
94 log_daemon_msg "Restarting $DESC" "$NAME"
101 1) log_end_msg 1 ;; # Old process is still running
102 *) log_end_msg 1 ;; # Failed to start
112 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2