From a405070d275132dc02435dc4d5bffee16f78e702 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 18 Feb 2015 23:15:58 +0000 Subject: 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. --- .../systemd/system/openvswitch-wait-for-bind@.service | 16 ++++++++++++++++ openstack/manifest | 1 + 2 files changed, 17 insertions(+) create mode 100644 openstack/etc/systemd/system/openvswitch-wait-for-bind@.service 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 diff --git a/openstack/manifest b/openstack/manifest index 8c7b9915..9229606a 100644 --- a/openstack/manifest +++ b/openstack/manifest @@ -141,6 +141,7 @@ 0100644 0 0 /etc/systemd/system/openvswitch-setup.service 0100644 0 0 /etc/systemd/system/openvswitch-db-server.service 0100644 0 0 /etc/systemd/system/openvswitch.service +0100644 0 0 /etc/systemd/system/openvswitch-wait-for-bind@.service 0100755 0 0 /usr/share/openstack/openstack-neutron-network-configuration-for-one-node 0100644 0 0 /etc/systemd/system/openstack-neutron-network-configuration-one-node.service 0100644 0 0 /etc/systemd/system/openvswitch-initialize-db.service -- cgit v1.2.1