diff options
author | Thomas Graf <tgraf@redhat.com> | 2013-01-25 17:31:56 +0100 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-01-25 10:34:11 -0800 |
commit | 3214851c31538e8690e31f95702f8927a8c0838b (patch) | |
tree | b70937f0e63d625e22ecefa920bafdf32f91cef6 /rhel | |
parent | 602453000e28ec1076c0482ce13c284765a84409 (diff) |
rhel: Add OVSREQUIRES to automatically bring up OpenFlow interface dependencies
The use of OpenFlow controllers may require for a subset of
the network (typically the management network intrerface) to be
brought up before the openvswitch service is started.
The newly introduced key "OVSREQUIRES" allows to specify a
list of interfaces that need the be brought up before the
openvswitch service is autostarted. It is also possible to
build a chain of bridge dependencies.
TYPE=OVSBridge
OVSREQURIES="em1"
[...]
A special UPPEDSTACK var that is passed along avoids getting
lost in dependency loops.
Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'rhel')
-rwxr-xr-x | rhel/etc_sysconfig_network-scripts_ifup-ovs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs index efafeada..35387214 100755 --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs @@ -34,6 +34,25 @@ if [ ! -x ${OTHERSCRIPT} ]; then OTHERSCRIPT="/etc/sysconfig/network-scripts/ifup-eth" fi +check_recursion() +{ + [ -n "${UPPEDSTACK}" ] && for _r in ${UPPEDSTACK}; do + [ "$_r" = "$1" ] && return 1 + done + + return 0 +} + +if [ -z "${UPPEDSTACK}" ]; then + UPPEDSTACK="${DEVICE}" +fi + +[ -n "${OVSREQUIRES}" ] && for _i in ${OVSREQUIRES}; do + if ( check_recursion "$_i" ); then + UPPEDSTACK="${UPPEDSTACK} $_i" /sbin/ifup "$_i" + fi +done + [ -f /var/lock/subsys/openvswitch ] || /sbin/service openvswitch start case "$TYPE" in |