- Timestamp:
- Aug 7, 2008, 10:01:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-remctl-auto/debian/sipb-xen-remctl-auto.init
r834 r875 1 #! /bin/bash 2 ### BEGIN INIT INFO 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 7 # Default-Stop: 0 1 6 8 # Short-Description: conserver config from invirt config for invirt host 9 # Description: 10 ### END INIT INFO 1 #!/bin/bash 11 2 12 # Author: Invirt/XVM Project, MIT SIPB <invirt@mit.edu> 3 PACKAGE=sipb-xen-remctl-auto 13 4 14 # Do NOT "set -e"15 16 # PATH should only include /usr/* if it runs after the mountnfs.sh script17 PATH=/sbin:/usr/sbin:/bin:/usr/bin18 DESC="Invirt host console config"19 NAME=sipb-xen-remctl-auto20 SCRIPTNAME=/etc/init.d/$NAME21 22 # Read configuration variable file if it is present23 [ -r /etc/default/$NAME ] && . /etc/default/$NAME24 25 # Load the VERBOSE setting and other rcS variables26 . /lib/init/vars.sh27 28 # Define LSB log_* functions.29 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.30 5 . /lib/lsb/init-functions 31 6 … … 36 11 } 37 12 38 #39 # Function that starts the daemon/service40 #41 do_start()42 {43 # Return44 # 0 if daemon has been started45 # 1 if daemon was already running46 # 2 if daemon could not be started47 gen_config48 }49 50 #51 # Function that stops the daemon/service52 #53 do_stop()54 {55 return 056 }57 58 do_reload()59 {60 gen_config61 }62 63 13 case "$1" in 64 start) 65 [ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME" 66 do_start 67 case "$?" in 68 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 69 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; 70 esac 71 ;; 14 start|reload|force-reload|restart) 15 log_begin_msg "Reloading config for $PACKAGE" 16 gen_config 17 log_end_msg $? 18 ;; 72 19 stop) 73 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" 74 do_stop 75 case "$?" in 76 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 77 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; 78 esac 79 ;; 80 reload|force-reload) 81 log_daemon_msg "Reloading $DESC" "$NAME" 82 do_reload 83 log_end_msg $? 84 ;; 85 restart) 86 log_daemon_msg "Restarting $DESC" "$NAME" 87 do_stop 88 case "$?" in 89 0|1) 90 do_start 91 case "$?" in 92 0) log_end_msg 0 ;; 93 1) log_end_msg 1 ;; # Old process is still running 94 *) log_end_msg 1 ;; # Failed to start 95 esac 96 ;; 97 *) 98 # Failed to stop 99 log_end_msg 1 100 ;; 101 esac 102 ;; 20 ;; 103 21 *) 104 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 105 exit 3 106 ;; 22 log_success_msg "Usage: /etc/init.d/$PACKAGE {start|reload|force-reload|restart|stop}" 23 ;; 107 24 esac 108 109 :
Note: See TracChangeset
for help on using the changeset viewer.