From: Ben Pfaff Date: Mon, 28 Mar 2011 23:22:59 +0000 (-0700) Subject: xenserver: Wait for ovs-xapi-sync to exit in "stop" command. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3d5b900a8c81020351151bab57fdc000a90827d;p=openvswitch xenserver: Wait for ovs-xapi-sync to exit in "stop" command. It seems possible that "restart" or a quick application of "stop" then "start" could kill ovs-xapi-sync without starting it again, if ovs-xapi-sync takes a little while to die, long enough for the next instance of it to see that its pidfile is still open and locked. I hope that this fixes some odd races that we've noticed in the "restart" command. Signed-off-by: Ben Pfaff --- diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch index 73009813..dfd8c39a 100755 --- a/xenserver/etc_init.d_openvswitch +++ b/xenserver/etc_init.d_openvswitch @@ -109,6 +109,8 @@ esac : ${VSWITCHD_VALGRIND_LOG:=} : ${VSWITCHD_VALGRIND_OPT:=} +: ${OVS_XAPI_SYNC_PIDFILE:=/var/run/openvswitch/ovs-xapi-sync.pid} + # Full paths to executables & modules ovsdb_server="/usr/sbin/ovsdb-server" ovsdb_tool="/usr/bin/ovsdb-tool" @@ -382,9 +384,7 @@ function start { function stop { stop_daemon VSWITCHD "$vswitchd" stop_daemon OVSDB_SERVER "$ovsdb_server" - if [ -e /var/run/openvswitch/ovs-xapi-sync.pid ]; then - kill `cat /var/run/openvswitch/ovs-xapi-sync.pid` - fi + stop_daemon OVS_XAPI_SYNC ovs-xapi-sync rm -f /var/lock/subsys/openvswitch }