Changeset 269 for trunk/packages/sipb-xen-dns/debian/sipb-xen-dns.init
- Timestamp:
- Feb 24, 2008, 10:34:49 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-dns/debian/sipb-xen-dns.init
r268 r269 19 19 # PATH should only include /usr/* if it runs after the mountnfs.sh script 20 20 PATH=/sbin:/usr/sbin:/bin:/usr/bin 21 DESC=" Description of the service"22 NAME= daemonexecutablename23 DAEMON=/usr/ sbin/$NAME24 DAEMON_ARGS=" --options args"21 DESC="The sipb-xen DNS server" 22 NAME=sipb-xen-dns 23 DAEMON=/usr/local/lib/sipb-xen-dns/dnsserver.py 24 DAEMON_ARGS="" 25 25 PIDFILE=/var/run/$NAME.pid 26 26 SCRIPTNAME=/etc/init.d/$NAME … … 48 48 # 1 if daemon was already running 49 49 # 2 if daemon could not be started 50 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ 51 || return 1 52 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ 53 $DAEMON_ARGS \ 54 || return 2 55 # Add code here, if necessary, that waits for the process to be ready 56 # to handle requests from services started subsequently which depend 57 # on this one. As a last resort, sleep for some time. 50 daemon --running -n $NAME && return 1 51 daemon -r -n $NAME -U $DAEMON $DAEMON_ARGS || return 2 58 52 } 59 53 … … 68 62 # 2 if daemon could not be stopped 69 63 # other if a failure occurred 70 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name$NAME64 daemon --stop -n $NAME 71 65 RETVAL="$?" 72 66 [ "$RETVAL" = 2 ] && return 2 73 # Wait for children to finish too if this is a daemon that forks74 # and if the daemon is only ever run from this initscript.75 # If the above conditions are not satisfied then add some other code76 # that waits for the process to drop all resources that could be77 # needed by services started subsequently. A last resort is to78 # sleep for some time.79 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON80 [ "$?" = 2 ] && return 281 67 # Many daemons don't delete their pidfiles when they exit. 82 68 rm -f $PIDFILE 83 69 return "$RETVAL" 84 }85 86 #87 # Function that sends a SIGHUP to the daemon/service88 #89 do_reload() {90 #91 # If the daemon can reload its configuration without92 # restarting (for example, when it is sent a SIGHUP),93 # then implement that here.94 #95 start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME96 return 097 70 } 98 71
Note: See TracChangeset
for help on using the changeset viewer.