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 <blp@nicira.com>
: ${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"
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
}