Comment 30 for bug 1912844

Revision history for this message
Frode Nordahl (fnordahl) wrote :

> Another question: is there a canonical way to determine if OVS isn't up? Currently I'm trying to execute a command and looking for "database connection failed" in the output, is that appropriate?

In the Ubuntu systemd service we assess the database socket:
https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/openvswitch/tree/debian/openvswitch-switch.ovs-vswitchd.service#n7

But I guess assessing tools most likely to be in your path would be
more portable, so calling `ovs-vsctl` and assessing the result would
work ok.

One thing to keep in mind is that the OVS/OVN -ctl tools may get into
a situation where they wait indefinitely. That can for example happen
if the OVSDB server is running but the vSwitch is not.

To mitigate that you can use the -t or --timeout option when calling
`ovs-vsctl`.

To assess whether the `ovs-vswitchd` process is alive independently of
the OVSDB you could have an additional check that talks to it on its
control socket, for example:

    `ovs-appctl -t ovs-vswitchd version`