3 # Provides: xvm-iscsi-config
4 # Required-Start: $local_fs $remote_fs
5 # Required-Stop: $local_fs $remote_fs
6 # Default-Start: 2 3 4 5
8 # Short-Description: XVM iSCSI config
9 # Description: Re-generate the iSCSI config for XVM's shared storage
12 # Author: SIPB XVM Project <xvm@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="Re-generate the iSCSI config"
21 # Read configuration variable file if it is present
22 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
24 # Load the VERBOSE setting and other rcS variables
27 # Define LSB log_* functions.
28 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
29 . /lib/lsb/init-functions
32 # Function that starts the daemon/service
37 # 0 if daemon has been started
38 # 1 if daemon was already running
39 # 2 if daemon could not be started
40 for i in /etc/iscsi/iscsid.conf.xvm
41 do mako-render $i.mako > $i
46 # Function that stops the daemon/service
51 # 0 if daemon has been stopped
52 # 1 if daemon was already stopped
53 # 2 if daemon could not be stopped
54 # other if a failure occurred
60 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
63 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
64 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
68 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
71 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
72 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
76 log_daemon_msg "Restarting $DESC" "$NAME"
83 1) log_end_msg 1 ;; # Old process is still running
84 *) log_end_msg 1 ;; # Failed to start
94 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2