X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=debian%2Fopenvswitch-switch.init;h=0907cdf7ca96120253b872f3a682a32f13537be9;hb=998bb652ecb494af8aa38ed0ae4e653cd8dff709;hp=43a320475028de7f23ddab5182aa46debdd323c4;hpb=24e81092a136e4a60443dc6a04206c2a631ace3a;p=openvswitch diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index 43a32047..0907cdf7 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -12,7 +12,7 @@ ### BEGIN INIT INFO # Provides: openvswitch-switch # Required-Start: $network $named $remote_fs $syslog -# Required-Stop: +# Required-Stop: $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Open vSwitch switch @@ -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 } @@ -191,14 +191,11 @@ unload_modules() { done fi unload_module openvswitch_mod - unload_module ip_gre_mod } case "$1" in start) load_module openvswitch_mod - unload_module ip_gre - load_module ip_gre_mod if test -n "$CORE_LIMIT"; then check_op "Setting core limit to $CORE_LIMIT" ulimit -c "$CORE_LIMIT" @@ -233,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 @@ -248,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." @@ -255,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." @@ -276,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." ;; @@ -330,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 ;;