]> git.proxmox.com Git - ovs.git/commit
rhel-systemd: Restart openvswitch service if a daemon crashes
authorEelco Chaudron <echaudro@redhat.com>
Mon, 27 Feb 2017 20:56:41 +0000 (15:56 -0500)
committerRussell Bryant <russell@ovn.org>
Mon, 27 Feb 2017 20:58:19 +0000 (15:58 -0500)
commitc19bf36d848cbdf755c6760fad1726c95e4377f1
treef26f4f93d3f74f604507cc800ca6a2f2049b595d
parent7a983037025d93745699296bda5fb92367822343
rhel-systemd: Restart openvswitch service if a daemon crashes

Currently if either ovsdb-server or ovs-vswitchd is crashing the
daemon is not restarting leaving the system in faulty state.
This patch will detect the daemon crash and will restart the
openvswitch service.

Here is a (bit to wide) table showing the behavior before and after
the patch. Note that only the Crash behavior has changed:

Before patch:
                               |       Process Status        |             systemctl <> status            |
                               | ovs-vswitchd | ovsdb-server | openvswitch  | ovs-vswitchd | ovsdb-server |
                               +--------------+--------------+--------------+--------------+--------------+
systemctl start openvswitch*   | started      | started      |active,exited |active,running|active,running|
Crash vswitchd                 | crashed      | stopped      |inactive, dead|failed        |inactive,dead |
Crash ovsdb                    | stopped      | crashed      |inactive, dead|inactive,dead |failed        |
systemctl restart openvswitch  | re-started   | re-started   |active,exited |active,running|active,running|
systemctl restart ovs-vswitchd | re-started   | re-started   |active,exited |active,running|active,running|
systemctl restart ovsdb-server | re-started   | re-started   |active,exited |active,running|active,running|
systemctl stop openvswitch     | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl stop ovs-vswitchd    | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl stop ovsdb-server    | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl start ovs-vswitchd*  | started      | started      |inactive, dead|active,running|active,running|
systemctl start ovsdb-server*  | not started  | started      |inactive, dead|inactive, dead|active,running|

With patch:
                               |       Process Status        |             systemctk <> status            |
                               | ovs-vswitchd | ovsdb-server | openvswitch  | ovs-vswitchd | ovsdb-server |
                               +--------------+--------------+--------------+--------------+--------------+
systemctl start openvswitch*   | started      | started      |active,exited |active,running|active,running|
Crash vswitchd                 | crash,started| re-started   |active,exited |active,running|active,running|
Crash ovsdb                    | re-started   | crash,started|active,exited |active,running|active,running|
systemctl restart openvswitch  | re-started   | re-started   |active,exited |active,running|active,running|
systemctl restart ovs-vswitchd | re-started   | re-started   |active,exited |active,running|active,running|
systemctl restart ovsdb-server | re-started   | re-started   |active,exited |active,running|active,running|
systemctl stop openvswitch     | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl stop ovs-vswitchd    | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl stop ovsdb-server    | stopped      | stopped      |inactive, dead|inactive,dead |inactive,dead |
systemctl start ovs-vswitchd*  | started      | started      |inactive, dead|active,running|active,running|
systemctl start ovsdb-server*  | not started  | started      |inactive, dead|inactive, dead|active,running|

* These commands where executed when no ovs related processes where
  running. All other commands where executed when OVS was successfully
  running.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Markos Chandras <mchandras@suse.de>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Russell Bryant <russell@ovn.org>
rhel/usr_lib_systemd_system_openvswitch.service
rhel/usr_lib_systemd_system_ovs-vswitchd.service
rhel/usr_lib_systemd_system_ovsdb-server.service