X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=debian%2Fopenvswitch-switchui.init;h=be547b114e735d6148a46d7f41ca376af3dc5cc4;hb=c16e55cf846f7a04a28730e25193d6a8ccd95f11;hp=7a02c5eacf9b9f463f8231ccc3d22d3ae0e36518;hpb=064af42167bf4fc9aaea2702d80ce08074b889c0;p=openvswitch diff --git a/debian/openvswitch-switchui.init b/debian/openvswitch-switchui.init index 7a02c5ea..be547b11 100755 --- a/debian/openvswitch-switchui.init +++ b/debian/openvswitch-switchui.init @@ -24,8 +24,8 @@ # ### BEGIN INIT INFO # Provides: openvswitch-switchui -# Required-Start: $network $local_fs -# Required-Stop: +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $remote_fs # Should-Start: $named $syslog openvswitch-switch # Should-Stop: # Default-Start: 2 3 4 5 @@ -37,9 +37,9 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/bin/ovs-switchui NAME=openvswitch-switchui -DESC="Open vSwitch switch monitor" +DESC="Open vSwitch UI" -PIDFILE=/var/run/$NAME.pid +PIDFILE=/var/run/openvswitch/$NAME.pid test -x $DAEMON || exit 0 @@ -56,7 +56,7 @@ DODTIME=10 # Time to wait for the server to die, in seconds # Include defaults if available if [ -f /etc/default/$NAME ] ; then - . /etc/default/$NAME + . /etc/default/$NAME fi set -e @@ -99,10 +99,10 @@ start_server() { # Wait up to 3 seconds for the daemon to start. for i in 1 2 3; do - if running; then - break - fi - sleep 1 + if running; then + break + fi + sleep 1 done } @@ -112,27 +112,27 @@ stop_server() { force_stop() { # Force the process to die killing it manually - [ ! -e "$PIDFILE" ] && return - if running ; then - kill -15 $pid - # Is it really dead? - sleep "$DIETIME"s - if running ; then - kill -9 $pid - sleep "$DIETIME"s - if running ; then - echo "Cannot kill $NAME (pid=$pid)!" - exit 1 - fi - fi - fi - rm -f $PIDFILE + [ ! -e "$PIDFILE" ] && return + if running ; then + kill -15 $pid + # Is it really dead? + sleep "$DIETIME"s + if running ; then + kill -9 $pid + sleep "$DIETIME"s + if running ; then + echo "Cannot kill $NAME (pid=$pid)!" + exit 1 + fi + fi + fi + rm -f $PIDFILE } case "$1" in start) - log_daemon_msg "Starting $DESC " "$NAME" + log_daemon_msg "Starting $DESC " "$NAME" # Check if it's running first if running ; then log_progress_msg "apparently already running" @@ -150,7 +150,7 @@ case "$1" in # a false positive (use 'status' for that) log_end_msg 1 fi - ;; + ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" if running ; then @@ -173,7 +173,7 @@ case "$1" in force_stop log_end_msg $? fi - ;; + ;; restart|force-reload) log_daemon_msg "Restarting $DESC" "$NAME" stop_server @@ -182,7 +182,7 @@ case "$1" in start_server running log_end_msg $? - ;; + ;; status) log_daemon_msg "Checking status of $DESC" "$NAME" @@ -201,10 +201,10 @@ case "$1" in log_warning_msg "cannot re-read the config file (use restart)." ;; *) - N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 - exit 1 - ;; + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 + exit 1 + ;; esac exit 0