Changeset 1253 for trunk/packages
- Timestamp:
- Oct 25, 2008, 4:54:19 PM (16 years ago)
- Location:
- trunk/packages/sipb-xen-iptables/debian
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-iptables/debian/changelog
r1055 r1253 1 sipb-xen-iptables (3) unstable; urgency=low 2 3 * shorten initscript with std-init.sh 4 5 -- Greg Price <price@mit.edu> Sat, 25 Oct 2008 15:35:09 -0400 6 1 7 sipb-xen-iptables (2) unstable; urgency=low 2 8 -
trunk/packages/sipb-xen-iptables/debian/sipb-xen-iptables.init
r1055 r1253 10 10 ### END INIT INFO 11 11 12 # Author: SIPB Xen Project <sipb-xen@mit.edu> 12 NAME=sipb-xen-iptables 13 DESC="Load the sipb-xen iptables rules" 14 RULES=/usr/share/sipb-xen-iptables/iptables.rules 15 GEN_FILES=$RULES 16 PATH=/sbin:/usr/sbin:/bin:/usr/bin 13 17 14 # Do NOT "set -e" 18 dpkg -s "$NAME" >/dev/null 2>/dev/null || exit 0 15 19 16 # PATH should only include /usr/* if it runs after the mountnfs.sh script 17 PATH=/sbin:/usr/sbin:/bin:/usr/bin 18 DESC="Load the sipb-xen iptables rules" 19 NAME=sipb-xen-iptables 20 RULES=/usr/share/sipb-xen-iptables/iptables.rules 20 . /lib/init/gen-files.sh 21 . /lib/init/std-init.sh 21 22 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 . /lib/lsb/init-functions31 32 #33 # Function that starts the daemon/service34 #35 23 do_start() 36 24 { 37 # Return 38 # 0 if daemon has been started 39 # 1 if daemon was already running 40 # 2 if daemon could not be started 41 for i in /usr/share/sipb-xen-iptables/iptables.rules 42 do mako-render $i.mako > $i 43 done 44 25 gen_files 45 26 /sbin/iptables-restore < $RULES 46 27 } 47 28 48 #49 # Function that stops the daemon/service50 #51 29 do_stop() 52 30 { 53 # Return54 # 0 if daemon has been stopped55 # 1 if daemon was already stopped56 # 2 if daemon could not be stopped57 # other if a failure occurred58 31 return 0 59 32 } 60 33 61 case "$1" in 62 start) 63 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" 64 do_start 65 case "$?" in 66 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 67 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; 68 esac 69 ;; 70 stop) 71 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" 72 do_stop 73 case "$?" in 74 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 75 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; 76 esac 77 ;; 78 #reload|force-reload) 79 # 80 # If do_reload() is not implemented then leave this commented out 81 # and leave 'force-reload' as an alias for 'restart'. 82 # 83 #log_daemon_msg "Reloading $DESC" "$NAME" 84 #do_reload 85 #log_end_msg $? 86 #;; 87 restart|force-reload) 88 # 89 # If the "reload" option is implemented then remove the 90 # 'force-reload' alias 91 # 92 log_daemon_msg "Restarting $DESC" "$NAME" 93 do_stop 94 case "$?" in 95 0|1) 96 do_start 97 case "$?" in 98 0) log_end_msg 0 ;; 99 1) log_end_msg 1 ;; # Old process is still running 100 *) log_end_msg 1 ;; # Failed to start 101 esac 102 ;; 103 *) 104 # Failed to stop 105 log_end_msg 1 106 ;; 107 esac 108 ;; 109 *) 110 #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 111 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 112 exit 3 113 ;; 114 esac 115 116 : 34 std_init "$1"
Note: See TracChangeset
for help on using the changeset viewer.