3 # Provides: sipb-xen-remctl-auto
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-remctl-auto
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 echo "host/$(invirt-getconf remote.hostname)@$(invirt-getconf authn.0.realm)" \
35 > /etc/remctl/acl/remote
39 # Function that starts the daemon/service
44 # 0 if daemon has been started
45 # 1 if daemon was already running
46 # 2 if daemon could not be started
51 # Function that stops the daemon/service
65 [ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
68 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
69 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
73 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
76 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
77 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
81 log_daemon_msg "Reloading $DESC" "$NAME"
86 log_daemon_msg "Restarting $DESC" "$NAME"
93 1) log_end_msg 1 ;; # Old process is still running
94 *) log_end_msg 1 ;; # Failed to start
104 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2