X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=debian%2Fopenvswitch-controller.init;h=a5403b84366863506b1fd77b1f0b3897c18135f4;hb=dd1ba5b3f4425c8eba008d1a93b044da63466812;hp=c5f8eb8fb5f854e98dbe64088c0c159a2bc76287;hpb=02dd3123a0e312f1d33403e744af52dd6096f12d;p=sliver-openvswitch.git diff --git a/debian/openvswitch-controller.init b/debian/openvswitch-controller.init index c5f8eb8fb..a5403b843 100755 --- a/debian/openvswitch-controller.init +++ b/debian/openvswitch-controller.init @@ -1,5 +1,6 @@ #!/bin/sh # +# Copyright (c) 2011 Nicira Networks Inc. # Copyright (c) 2007, 2009 Javier Fernandez-Sanguino # # This is free software; you may redistribute it and/or modify @@ -19,8 +20,8 @@ # ### BEGIN INIT INFO # Provides: openvswitch-controller -# Required-Start: $network $local_fs -# Required-Stop: +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $remote_fs # Should-Start: $named # Should-Stop: # Default-Start: 2 3 4 5 @@ -30,19 +31,19 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/sbin/controller # Introduce the server's location here +DAEMON=/usr/bin/ovs-controller # Introduce the server's location here NAME=ovs-controller # Introduce the short server's name here DESC=ovs-controller # Introduce a short description here LOGDIR=/var/log/openvswitch # Log directory to use -PIDFILE=/var/run/$NAME.pid +PIDFILE=/var/run/openvswitch/$NAME.pid test -x $DAEMON || exit 0 . /lib/lsb/init-functions # Default options, these can be overriden by the information -# at /etc/default/$NAME +# at /etc/default/openvswitch-controller DAEMON_OPTS="" # Additional options given to the server DODTIME=10 # Time to wait for the server to die, in seconds @@ -105,6 +106,10 @@ start_server() { exit 0 fi + if [ ! -d /var/run/openvswitch ]; then + install -d -m 755 -o root -g root /var/run/openvswitch + fi + SSL_OPTS= case $LISTEN in *ssl*) @@ -175,10 +180,10 @@ force_stop() { if running ; then kill -15 $pid # Is it really dead? - sleep "$DIETIME"s + sleep "$DODTIME" if running ; then kill -9 $pid - sleep "$DIETIME"s + sleep "$DODTIME" if running ; then echo "Cannot kill $NAME (pid=$pid)!" exit 1 @@ -237,7 +242,7 @@ case "$1" in log_daemon_msg "Restarting $DESC" "$NAME" stop_server # Wait some sensible amount, some server need this - [ -n "$DIETIME" ] && sleep $DIETIME + [ -n "$DODTIME" ] && sleep $DODTIME start_server running log_end_msg $? @@ -260,7 +265,7 @@ case "$1" in log_warning_msg "cannot re-read the config file (use restart)." ;; *) - N=/etc/init.d/$NAME + N=/etc/init.d/openvswitch-controller echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 exit 1 ;;