diff options
author | Alan Pevec <alan.pevec@redhat.com> | 2017-02-10 19:03:19 -0500 |
---|---|---|
committer | Russell Bryant <russell@ovn.org> | 2017-02-13 09:20:14 -0500 |
commit | 273cc28d8d1bf597c97450223ec17bbd444c0b37 (patch) | |
tree | bf849fa56bfec1e311b38eb5388d842d48f5c6c3 /rhel | |
parent | e6932e5dd59fe2bd7d90ef365bdd95707cd369d0 (diff) | |
download | openvswitch-273cc28d8d1bf597c97450223ec17bbd444c0b37.tar.gz |
rhel: make openvswitch service start return when ready
In OVS 2.6 openvswitch systemd service was changed to use BindsTo
instead of Requires for sub-services but also removed them from After
This made main openvswitch service return before sub-services were ready
breaking scripts which assumed everything is ready after systemctl start
e.g. in OpenStack CI infra [1] is calling ovs-vsctl immediately after
service start exposing a race in virtualized CI environment:
2017-02-09T23:11:12.498Z|00007|bridge|INFO|ovs-vswitchd (Open vSwitch) 2.6.1
but ovs-ctl tried to access it few msec too early:
2017-02-09 23:11:12.352493 | ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
Solution is to add ordering dependencies, BindsTo/Requires do not ensure it [2]
[1] https://github.com/openstack-infra/devstack-gate/blob/c435a724bd257b22a2e39e8e9125c11302a8c81d/functions.sh#L1057-L1078
[2] https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Requires=
Fixes: 84ad120 ("rhel: Improved Systemd Integration")
Signed-off-by: Alan Pevec <alan.pevec@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
Diffstat (limited to 'rhel')
-rw-r--r-- | rhel/usr_lib_systemd_system_openvswitch.service | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rhel/usr_lib_systemd_system_openvswitch.service b/rhel/usr_lib_systemd_system_openvswitch.service index e823c5454..bdbceaefb 100644 --- a/rhel/usr_lib_systemd_system_openvswitch.service +++ b/rhel/usr_lib_systemd_system_openvswitch.service @@ -1,7 +1,7 @@ [Unit] Description=Open vSwitch Before=network.target network.service -After=network-pre.target +After=network-pre.target ovsdb-server.service ovs-vswitchd.service PartOf=network.target BindsTo=ovsdb-server.service BindsTo=ovs-vswitchd.service |