- Timestamp:
- Nov 1, 2008, 12:28:57 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/xvm-iscsi-config/debian/xvm-iscsi-config.init
r1496 r1507 12 12 # Author: SIPB XVM Project <xvm@mit.edu> 13 13 14 # Do NOT "set -e" 15 16 # PATH should only include /usr/* if it runs after the mountnfs.sh script 14 NAME=xvm-iscsi-config 15 DESC="Re-generate the iSCSI config" 17 16 PATH=/sbin:/usr/sbin:/bin:/usr/bin 18 DESC="Re-generate the iSCSI config" 19 NAME=xvm-iscsi-config 17 GEN_FILES=/etc/iscsi/iscsid.conf.xvm 20 18 21 19 # Read configuration variable file if it is present 22 20 [ -r /etc/default/$NAME ] && . /etc/default/$NAME 23 21 24 # Load the VERBOSE setting and other rcS variables 25 . /lib/init/vars.sh 22 . /lib/init/config-init.sh 26 23 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 30 31 # 32 # Function that starts the daemon/service 33 # 34 do_start() 35 { 36 # Return 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 42 done 43 } 44 45 # 46 # Function that stops the daemon/service 47 # 48 do_stop() 49 { 50 # Return 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 55 return 0 56 } 57 58 case "$1" in 59 start) 60 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" 61 do_start 62 case "$?" in 63 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 64 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; 65 esac 66 ;; 67 stop) 68 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" 69 do_stop 70 case "$?" in 71 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 72 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; 73 esac 74 ;; 75 restart|force-reload) 76 log_daemon_msg "Restarting $DESC" "$NAME" 77 do_stop 78 case "$?" in 79 0|1) 80 do_start 81 case "$?" in 82 0) log_end_msg 0 ;; 83 1) log_end_msg 1 ;; # Old process is still running 84 *) log_end_msg 1 ;; # Failed to start 85 esac 86 ;; 87 *) 88 # Failed to stop 89 log_end_msg 1 90 ;; 91 esac 92 ;; 93 *) 94 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 95 exit 3 96 ;; 97 esac 98 99 : 24 config_init "$1"
Note: See TracChangeset
for help on using the changeset viewer.