summaryrefslogtreecommitdiff
path: root/openstack/etc
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-02-18 23:15:58 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2015-03-02 14:52:50 +0000
commit2c433589d29aab4cf05b9b0bd03298f148753dd1 (patch)
treecb6f4ab53eea56aaf3efec551108f735d5695c4e /openstack/etc
parentf26dfa93313a8674cca3b5b2bc557e64abf8eac8 (diff)
downloaddefinitions-2c433589d29aab4cf05b9b0bd03298f148753dd1.tar.gz
Add wait-for-bind script between openvswitch and network-pre
Ordering openvswitch before networkd is not sufficient alone, because openvswitch doesn't wait for all its initial config to complete before reporting that it has finished starting.
Diffstat (limited to 'openstack/etc')
-rw-r--r--openstack/etc/systemd/system/openvswitch-wait-for-bind@.service16
1 files changed, 16 insertions, 0 deletions
diff --git a/openstack/etc/systemd/system/openvswitch-wait-for-bind@.service b/openstack/etc/systemd/system/openvswitch-wait-for-bind@.service
new file mode 100644
index 00000000..a736fe3d
--- /dev/null
+++ b/openstack/etc/systemd/system/openvswitch-wait-for-bind@.service
@@ -0,0 +1,16 @@
+# Open vSwitch doesn't wait for all the interfaces to be configured before
+# reporting "started", but we need to start networkd after they have been bound,
+# so this unit waits for the interface to be bound before continuing, and is
+# ordered before network-pre.target, which networkd orders itself after.
+[Unit]
+Description=Wait for Open vSwitch to bind %i
+Requires=openvswitch.service
+After=openvswitch.service
+Before=network-pre.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStart=/bin/sh -c \
+ 'while ! readlink /sys/class/net/$1/master; do sleep 1; done' \
+ - %I