Auto-start openvswitch service on ifup/ifdown (#818754)

Also adds OVSREQUIRES to allow defining OpenFlow interface
dependencies
f38
Thomas Graf 12 years ago
parent 7b6246bc31
commit 6262ced949

@ -34,6 +34,8 @@ if [ ! -x ${OTHERSCRIPT} ]; then
OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-eth" OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-eth"
fi fi
[ -f /var/lock/subsys/openvswitch ] || /sbin/service openvswitch start
case "$TYPE" in case "$TYPE" in
OVSBridge) OVSBridge)
${OTHERSCRIPT} ${CONFIG} $2 ${OTHERSCRIPT} ${CONFIG} $2

@ -34,6 +34,27 @@ if [ ! -x ${OTHERSCRIPT} ]; then
OTHERSCRIPT="/etc/sysconfig/network-scripts/ifup-eth" OTHERSCRIPT="/etc/sysconfig/network-scripts/ifup-eth"
fi 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 case "$TYPE" in
OVSBridge) OVSBridge)
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}

@ -1,6 +1,6 @@
Name: openvswitch Name: openvswitch
Version: 1.7.3 Version: 1.7.3
Release: 6%{?dist} Release: 7%{?dist}
Summary: Open vSwitch daemon/database/utilities Summary: Open vSwitch daemon/database/utilities
# Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
@ -205,7 +205,11 @@ desktop-file-install --dir=$RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE6}
%changelog %changelog
* Thu Jan 24 2013 Thomas Graf <tgraf@redhat.com> - 1.7.3-1 * Fri Jan 25 2013 Thomas Graf <tgraf@redhat.com> - 1.7.3-7
- Auto-start openvswitch service on ifup/ifdown (#818754)
- Add OVSREQUIRES to allow defining OpenFlow interface dependencies
* Thu Jan 24 2013 Thomas Graf <tgraf@redhat.com> - 1.7.3-6
- Update to Open vSwitch 1.7.3 - Update to Open vSwitch 1.7.3
* Tue Nov 20 2012 Thomas Graf <tgraf@redhat.com> - 1.7.1-6 * Tue Nov 20 2012 Thomas Graf <tgraf@redhat.com> - 1.7.1-6

Loading…
Cancel
Save