X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=debian%2Fopenvswitch-switch.init;h=0907cdf7ca96120253b872f3a682a32f13537be9;hb=998bb652ecb494af8aa38ed0ae4e653cd8dff709;hp=ef92340fb5ee4e2bbe59115b7c37a7a31c505b1c;hpb=6f643e4946016399f0b217c2226284e3892b6267;p=openvswitch diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index ef92340f..0907cdf7 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -93,10 +93,10 @@ force_stop() { [ ! -f "$pidfile" ] && return if running $name; then kill $pid - [ -n "$DODTIME" ] && sleep "$DODTIME"s + [ -n "$DODTIME" ] && sleep "$DODTIME" if running $name; then kill -KILL $pid - [ -n "$DODTIME" ] && sleep "$DODTIME"s + [ -n "$DODTIME" ] && sleep "$DODTIME" if running $name; then echo "Cannot kill $name (pid=$pid)!" exit 1 @@ -157,7 +157,7 @@ load_module() { echo "For instructions, read" echo "/usr/share/doc/openvswitch-datapath-source/README.Debian" fi - exit 1 + exit 0 fi } @@ -230,12 +230,16 @@ case "$1" in install -d -m 755 -o root -g root /var/log/openvswitch fi + if [ ! -d /var/log/openvswitch/cores ]; then + install -d -m 755 -o root -g root /var/log/openvswitch/cores + fi + # Start ovsdb-server. set -- set -- "$@" /etc/openvswitch/conf.db set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err set -- "$@" --log-file=/var/log/openvswitch/ovsdb-server.log - set -- "$@" --detach --pidfile $monitor_opt + set -- "$@" --detach --no-chdir --pidfile $monitor_opt set -- "$@" --remote punix:/var/run/openvswitch/db.sock set -- "$@" --remote db:Open_vSwitch,managers set -- "$@" --private-key=db:SSL,private_key @@ -245,6 +249,7 @@ case "$1" in echo -n "Starting ovsdb-server: " start-stop-daemon --start --quiet \ --pidfile /var/run/openvswitch/ovsdb-server.pid \ + --chdir /var/log/openvswitch/cores \ --exec $ovsdb_server -- "$@" if running ovsdb-server; then echo "ovsdb-server." @@ -252,18 +257,19 @@ case "$1" in echo " ERROR." fi - ovs-vsctl --no-wait init + ovs-vsctl --no-wait --timeout=5 init # Start ovs-vswitchd. set -- set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err set -- "$@" --log-file=/var/log/openvswitch/ovs-vswitchd.log - set -- "$@" --detach --pidfile $monitor_opt + set -- "$@" --detach --no-chdir --pidfile $monitor_opt set -- "$@" unix:/var/run/openvswitch/db.sock set -- "$@" $OVS_VSWITCHD_OPTS echo -n "Starting ovs-vswitchd: " start-stop-daemon --start --quiet \ --pidfile /var/run/openvswitch/ovs-vswitchd.pid \ + --chdir /var/log/openvswitch/cores \ --exec $ovs_vswitchd -- "$@" if running ovs-vswitchd; then echo "ovs-vswitchd." @@ -273,14 +279,16 @@ case "$1" in ;; stop) echo -n "Stopping ovs-vswitchd: " - start-stop-daemon --stop --quiet --oknodo \ + start-stop-daemon --stop --quiet --oknodo --retry 5 \ --pidfile /var/run/openvswitch/ovs-vswitchd.pid \ + --chdir /var/log/openvswitch/cores \ --exec $ovs_vswitchd echo "ovs-vswitchd." echo -n "Stopping ovsdb-server: " - start-stop-daemon --stop --quiet --oknodo \ + start-stop-daemon --stop --quiet --oknodo --retry 5 \ --pidfile /var/run/openvswitch/ovsdb-server.pid \ + --chdir /var/log/openvswitch/cores \ --exec $ovsdb_server echo "ovsdb-server." ;; @@ -327,7 +335,7 @@ case "$1" in done ;; *) - N=/etc/init.d/$NAME + N=/etc/init.d/openvswitch-switch echo "Usage: $N {start|stop|restart|force-reload|status|force-stop|unload}" >&2 exit 1 ;;