applied upstream commit b49c106ef00438b1c59876dad90d00e8d6e7b627f38
parent
b33a7a6940
commit
8687c2c26b
@ -1,64 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (c) 2011 Alexey I. Froloff.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at:
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
. /etc/init.d/functions
|
||||
|
||||
cd /etc/sysconfig/network-scripts
|
||||
. ./network-functions
|
||||
|
||||
[ -f ../network ] && . ../network
|
||||
|
||||
CONFIG=${1}
|
||||
TIMEOUT=10
|
||||
|
||||
source_config
|
||||
|
||||
. /etc/sysconfig/network
|
||||
|
||||
OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-${REAL_DEVICETYPE}"
|
||||
|
||||
if [ ! -x ${OTHERSCRIPT} ]; then
|
||||
OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-eth"
|
||||
fi
|
||||
|
||||
if [ -x /usr/bin/systemctl ]; then
|
||||
if ! systemctl --quiet is-active openvswitch-nonetwork.service; then
|
||||
/usr/bin/systemctl start openvswitch-nonetwork.service
|
||||
fi
|
||||
else
|
||||
if [ ! -f /var/lock/subsys/openvswitch ]; then
|
||||
/sbin/service openvswitch start
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$TYPE" in
|
||||
OVSBridge)
|
||||
${OTHERSCRIPT} ${CONFIG} $2
|
||||
retval=$?
|
||||
ovs-vsctl -t ${TIMEOUT} -- --if-exists del-br "$DEVICE"
|
||||
;;
|
||||
OVSPort|OVSIntPort|OVSBond|OVSTunnel)
|
||||
${OTHERSCRIPT} ${CONFIG} $2
|
||||
retval=$?
|
||||
ovs-vsctl -t ${TIMEOUT} -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE"
|
||||
;;
|
||||
*)
|
||||
echo $"Invalid OVS interface type $TYPE"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $retval
|
@ -1,137 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (c) 2011 Alexey I. Froloff.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at:
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
. /etc/init.d/functions
|
||||
|
||||
cd /etc/sysconfig/network-scripts
|
||||
. ./network-functions
|
||||
|
||||
[ -f ../network ] && . ../network
|
||||
|
||||
CONFIG=${1}
|
||||
TIMEOUT=10
|
||||
|
||||
need_config ${CONFIG}
|
||||
|
||||
source_config
|
||||
|
||||
OTHERSCRIPT="/etc/sysconfig/network-scripts/ifup-${REAL_DEVICETYPE}"
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
ifup_ovs_bridge ()
|
||||
{
|
||||
if ovs-vsctl br-exists "${OVS_BRIDGE}"; then :; else
|
||||
/sbin/ifup "${OVS_BRIDGE}"
|
||||
fi
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if [ -x /usr/bin/systemctl ]; then
|
||||
if ! systemctl --quiet is-active openvswitch-nonetwork.service; then
|
||||
/usr/bin/systemctl start openvswitch-nonetwork.service
|
||||
fi
|
||||
else
|
||||
if [ ! -f /var/lock/subsys/openvswitch ]; then
|
||||
/sbin/service openvswitch start
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$TYPE" in
|
||||
OVSBridge)
|
||||
# If bridge already exists and is up, it has been configured through
|
||||
# other cases like OVSPort, OVSIntPort and OVSBond. If it is down or
|
||||
# it does not exist, create it. It is possible for a bridge to exist
|
||||
# because it remained in the OVSDB for some reason, but it won't be up.
|
||||
if check_device_down "${DEVICE}"; then
|
||||
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIONS \
|
||||
${OVS_EXTRA+-- $OVS_EXTRA} \
|
||||
${STP+-- set bridge "$DEVICE" stp_enable="${STP}"}
|
||||
else
|
||||
OVSBRIDGECONFIGURED="yes"
|
||||
fi
|
||||
|
||||
# When dhcp is enabled, the assumption is that there will be a port to
|
||||
# attach (otherwise, we can't reach out for dhcp). So, we do not
|
||||
# configure the bridge through rhel's ifup infrastructure unless
|
||||
# it is being configured after the port has been configured.
|
||||
# The "OVSINTF" is set only after the port is configured.
|
||||
if [ "${OVSBOOTPROTO}" = "dhcp" ] && [ -n "${OVSINTF}" ]; then
|
||||
case " ${OVSDHCPINTERFACES} " in
|
||||
*" ${OVSINTF} "*)
|
||||
BOOTPROTO=dhcp ${OTHERSCRIPT} ${CONFIG}
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# When dhcp is not enabled, it is possible that someone may want
|
||||
# a standalone bridge (i.e it may not have any ports). Configure it.
|
||||
if [ "${OVSBOOTPROTO}" != "dhcp" ] && [ -z "${OVSINTF}" ] && \
|
||||
[ "${OVSBRIDGECONFIGURED}" != "yes" ]; then
|
||||
${OTHERSCRIPT} ${CONFIG}
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
OVSPort)
|
||||
ifup_ovs_bridge
|
||||
${OTHERSCRIPT} ${CONFIG} ${2}
|
||||
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
|
||||
OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
|
||||
;;
|
||||
OVSIntPort)
|
||||
ifup_ovs_bridge
|
||||
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=internal ${OVS_EXTRA+-- $OVS_EXTRA}
|
||||
${OTHERSCRIPT} ${CONFIG} ${2}
|
||||
;;
|
||||
OVSBond)
|
||||
ifup_ovs_bridge
|
||||
for _iface in $BOND_IFACES; do
|
||||
/sbin/ifup ${_iface}
|
||||
done
|
||||
ovs-vsctl -t ${TIMEOUT} -- --fake-iface add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
|
||||
${OTHERSCRIPT} ${CONFIG} ${2}
|
||||
OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
|
||||
;;
|
||||
OVSTunnel)
|
||||
ifup_ovs_bridge
|
||||
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=$OVS_TUNNEL_TYPE $OVS_TUNNEL_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
|
||||
${OTHERSCRIPT} ${CONFIG} ${2}
|
||||
;;
|
||||
*)
|
||||
echo $"Invalid OVS interface type $TYPE"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
@ -0,0 +1,205 @@
|
||||
From f32488ec28a05e26e0298b3e10b3a7fe422fbf88 Mon Sep 17 00:00:00 2001
|
||||
From: Flavio Leitner <fbl@redhat.com>
|
||||
Date: Thu, 9 Jan 2014 01:04:33 -0200
|
||||
Subject: [PATCH] fedora package: fix systemd ordering and deps.
|
||||
|
||||
There is a chicken and egg issue where common OVS
|
||||
configuration uses a controller which is only accessible
|
||||
via the network. So starting OVS before network.target
|
||||
would break those configurations.
|
||||
|
||||
However, the network doesn't come up after boot because
|
||||
OVS isn't started until after the network scripts tries
|
||||
to configure the ovs.
|
||||
|
||||
This is partially fixed by commits:
|
||||
commit: 602453000e28ec1076c0482ce13c284765a84409
|
||||
rhel: Automatically start openvswitch service before bringing an ovs interfa
|
||||
|
||||
commit: 3214851c31538e8690e31f95702f8927a8c0838b
|
||||
rhel: Add OVSREQUIRES to automatically bring up OpenFlow interface dependencies
|
||||
|
||||
But still there is the dependency issue between network.target
|
||||
and openvswitch which this patch fixes it. It provides two systemd
|
||||
service units. One to run at any time (openvswitch-nonetwork.service)
|
||||
which runs 'ovs-ctl start' and the other one (openvswith.service) to
|
||||
run after network.target which works as a frontend to the admin.
|
||||
|
||||
The openvswitch-nonetwork.service is used internally by the
|
||||
'ifup-ovs/ifdown-ovs' scripts when adding or removing ports to
|
||||
the bridge or when the openvswitch.service is enabled by the admin.
|
||||
|
||||
Signed-off-by: Flavio Leitner <fbl@redhat.com>
|
||||
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
|
||||
---
|
||||
rhel/automake.mk | 4 +++-
|
||||
rhel/etc_sysconfig_network-scripts_ifdown-ovs | 11 ++++++++++-
|
||||
rhel/etc_sysconfig_network-scripts_ifup-ovs | 11 ++++++++++-
|
||||
rhel/openvswitch-fedora.spec.in | 5 ++++-
|
||||
...ib_systemd_system_openvswitch-nonetwork.service | 13 ++++++++++++
|
||||
rhel/usr_lib_systemd_system_openvswitch.service | 7 ++++---
|
||||
..._openvswitch_scripts_systemd_sysconfig.template | 23 ++++++++++++++++++++++
|
||||
7 files changed, 67 insertions(+), 7 deletions(-)
|
||||
create mode 100644 rhel/usr_lib_systemd_system_openvswitch-nonetwork.service
|
||||
create mode 100644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template
|
||||
|
||||
diff --git a/rhel/automake.mk b/rhel/automake.mk
|
||||
index 2911e71..9cd9a41 100644
|
||||
--- a/rhel/automake.mk
|
||||
+++ b/rhel/automake.mk
|
||||
@@ -22,7 +22,9 @@ EXTRA_DIST += \
|
||||
rhel/openvswitch-fedora.spec \
|
||||
rhel/openvswitch-fedora.spec.in \
|
||||
rhel/usr_share_openvswitch_scripts_sysconfig.template \
|
||||
- rhel/usr_lib_systemd_system_openvswitch.service
|
||||
+ rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
|
||||
+ rhel/usr_lib_systemd_system_openvswitch.service \
|
||||
+ rhel/usr_lib_systemd_system_openvswitch-nonetwork.service
|
||||
|
||||
update_rhel_spec = \
|
||||
($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
|
||||
diff --git a/rhel/etc_sysconfig_network-scripts_ifdown-ovs b/rhel/etc_sysconfig_network-scripts_ifdown-ovs
|
||||
index d2a2f4b..32fddb5 100755
|
||||
--- a/rhel/etc_sysconfig_network-scripts_ifdown-ovs
|
||||
+++ b/rhel/etc_sysconfig_network-scripts_ifdown-ovs
|
||||
@@ -34,7 +34,16 @@ if [ ! -x ${OTHERSCRIPT} ]; then
|
||||
OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-eth"
|
||||
fi
|
||||
|
||||
-[ -f /var/lock/subsys/openvswitch ] || /sbin/service openvswitch start
|
||||
+SERVICE_UNIT=/usr/lib/systemd/system/openvswitch-nonetwork.service
|
||||
+if [ -f $SERVICE_UNIT ] && [ -x /usr/bin/systemctl ]; then
|
||||
+ if ! systemctl --quiet is-active openvswitch-nonetwork.service; then
|
||||
+ systemctl start openvswitch-nonetwork.service
|
||||
+ fi
|
||||
+else
|
||||
+ if [ ! -f /var/lock/subsys/openvswitch ]; then
|
||||
+ /sbin/service openvswitch start
|
||||
+ fi
|
||||
+fi
|
||||
|
||||
case "$TYPE" in
|
||||
OVSBridge)
|
||||
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
|
||||
index 8904c59..3c6b557 100755
|
||||
--- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
|
||||
+++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
|
||||
@@ -60,7 +60,16 @@ fi
|
||||
fi
|
||||
done
|
||||
|
||||
-[ -f /var/lock/subsys/openvswitch ] || /sbin/service openvswitch start
|
||||
+SERVICE_UNIT=/usr/lib/systemd/system/openvswitch-nonetwork.service
|
||||
+if [ -f $SERVICE_UNIT ] && [ -x /usr/bin/systemctl ]; then
|
||||
+ if ! systemctl --quiet is-active openvswitch-nonetwork.service; then
|
||||
+ systemctl start openvswitch-nonetwork.service
|
||||
+ fi
|
||||
+else
|
||||
+ if [ ! -f /var/lock/subsys/openvswitch ]; then
|
||||
+ /sbin/service openvswitch start
|
||||
+ fi
|
||||
+fi
|
||||
|
||||
case "$TYPE" in
|
||||
OVSBridge)
|
||||
diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
|
||||
index 27a3b03..8a5505d 100644
|
||||
--- a/rhel/openvswitch-fedora.spec.in
|
||||
+++ b/rhel/openvswitch-fedora.spec.in
|
||||
@@ -45,6 +45,8 @@ install -d -m 755 $RPM_BUILD_ROOT/etc
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/openvswitch
|
||||
install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch.service \
|
||||
$RPM_BUILD_ROOT%{_unitdir}/openvswitch.service
|
||||
+install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
|
||||
+ $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service
|
||||
install -m 755 rhel/etc_init.d_openvswitch \
|
||||
$RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
|
||||
install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
|
||||
@@ -60,7 +62,7 @@ install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
|
||||
$RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifdown-ovs
|
||||
install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
|
||||
$RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifup-ovs
|
||||
-install -p -D -m 0644 rhel/usr_share_openvswitch_scripts_sysconfig.template \
|
||||
+install -p -D -m 0644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
|
||||
$RPM_BUILD_ROOT/etc/sysconfig/openvswitch
|
||||
install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
|
||||
|
||||
@@ -101,6 +103,7 @@ systemctl start openvswitch.service
|
||||
%config /etc/sysconfig/openvswitch
|
||||
%config /etc/logrotate.d/openvswitch
|
||||
%{_unitdir}/openvswitch.service
|
||||
+%{_unitdir}/openvswitch-nonetwork.service
|
||||
%{_datadir}/openvswitch/scripts/openvswitch.init
|
||||
%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
|
||||
%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
|
||||
diff --git a/rhel/usr_lib_systemd_system_openvswitch-nonetwork.service b/rhel/usr_lib_systemd_system_openvswitch-nonetwork.service
|
||||
new file mode 100644
|
||||
index 0000000..870b25e
|
||||
--- /dev/null
|
||||
+++ b/rhel/usr_lib_systemd_system_openvswitch-nonetwork.service
|
||||
@@ -0,0 +1,13 @@
|
||||
+[Unit]
|
||||
+Description=Open vSwitch Internal Unit
|
||||
+After=syslog.target
|
||||
+PartOf=openvswitch.service
|
||||
+Wants=openvswitch.service
|
||||
+
|
||||
+[Service]
|
||||
+Type=oneshot
|
||||
+RemainAfterExit=yes
|
||||
+EnvironmentFile=-/etc/sysconfig/openvswitch
|
||||
+ExecStart=/usr/share/openvswitch/scripts/ovs-ctl start \
|
||||
+ --system-id=random $OPTIONS
|
||||
+ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop
|
||||
diff --git a/rhel/usr_lib_systemd_system_openvswitch.service b/rhel/usr_lib_systemd_system_openvswitch.service
|
||||
index f39d7e6..f0bc16f 100644
|
||||
--- a/rhel/usr_lib_systemd_system_openvswitch.service
|
||||
+++ b/rhel/usr_lib_systemd_system_openvswitch.service
|
||||
@@ -1,11 +1,12 @@
|
||||
[Unit]
|
||||
Description=Open vSwitch
|
||||
-After=syslog.target network.target
|
||||
+After=syslog.target network.target openvswitch-nonetwork.service
|
||||
+Requires=openvswitch-nonetwork.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
-ExecStart=/usr/share/openvswitch/scripts/openvswitch.init start
|
||||
-ExecStop=/usr/share/openvswitch/scripts/openvswitch.init stop
|
||||
+ExecStart=/bin/true
|
||||
+ExecStop=/bin/true
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
diff --git a/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template b/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template
|
||||
new file mode 100644
|
||||
index 0000000..3050a07
|
||||
--- /dev/null
|
||||
+++ b/rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template
|
||||
@@ -0,0 +1,23 @@
|
||||
+### Configuration options for openvswitch
|
||||
+#
|
||||
+# Enable core files:
|
||||
+# --force-corefiles=yes
|
||||
+#
|
||||
+# Set "nice" priority at which to run ovsdb-server:
|
||||
+# --ovsdb-server-priority=-10
|
||||
+#
|
||||
+# Set "nice" priority at which to run ovsdb-vswitchd:
|
||||
+# --ovs-vswitchd-priority=-10
|
||||
+#
|
||||
+# Pass or not --mlockall option to ovs-vswitchd.
|
||||
+# This option should be set to "yes" or "no". The default is "yes".
|
||||
+# Enabling this option can avoid networking interruptions due to
|
||||
+# system memory pressure in extraordinary situations, such as multiple
|
||||
+# concurrent VM import operations.
|
||||
+# --mlockall=yes
|
||||
+#
|
||||
+# Use valgrind:
|
||||
+# --ovs-vswitchd-wrapper=valgrind
|
||||
+# --ovsdb-server-wrapper=valgrind
|
||||
+#
|
||||
+OPTIONS=""
|
||||
--
|
||||
1.8.4.2
|
||||
|
@ -0,0 +1,29 @@
|
||||
diff --git a/rhel/etc_sysconfig_network-scripts_ifdown-ovs b/rhel/etc_sysconfig_network-scripts_ifdown-ovs
|
||||
index 32fddb5..daa5786 100755
|
||||
--- a/rhel/etc_sysconfig_network-scripts_ifdown-ovs
|
||||
+++ b/rhel/etc_sysconfig_network-scripts_ifdown-ovs
|
||||
@@ -51,7 +51,7 @@ case "$TYPE" in
|
||||
retval=$?
|
||||
ovs-vsctl -t ${TIMEOUT} -- --if-exists del-br "$DEVICE"
|
||||
;;
|
||||
- OVSPort|OVSIntPort|OVSBond)
|
||||
+ OVSPort|OVSIntPort|OVSBond|OVSTunnel)
|
||||
${OTHERSCRIPT} ${CONFIG} $2
|
||||
retval=$?
|
||||
ovs-vsctl -t ${TIMEOUT} -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE"
|
||||
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
|
||||
index 3c6b557..3f31c30 100755
|
||||
--- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
|
||||
+++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
|
||||
@@ -126,6 +126,11 @@ case "$TYPE" in
|
||||
${OTHERSCRIPT} ${CONFIG} ${2}
|
||||
OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
|
||||
;;
|
||||
+ OVSTunnel)
|
||||
+ ifup_ovs_bridge
|
||||
+ ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=$OVS_TUNNEL_TYPE $OVS_TUNNEL_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
|
||||
+ ${OTHERSCRIPT} ${CONFIG} ${2}
|
||||
+ ;;
|
||||
*)
|
||||
echo $"Invalid OVS interface type $TYPE"
|
||||
exit 1
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Open vSwitch Internal Unit
|
||||
After=syslog.target
|
||||
PartOf=openvswitch.service
|
||||
Wants=openvswitch.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=-/etc/sysconfig/openvswitch
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/share/openvswitch/scripts/ovs-ctl start --system-id=random \
|
||||
$FORCE_COREFILES $OVSDB_SERVER_PRIORITY $VSWITCHD_PRIORITY \
|
||||
$VSWITCHD_MLOCKALL $BRCOMPAT $OVS_CTL_OPTS
|
||||
ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop
|
@ -1,100 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# openvswitch
|
||||
#
|
||||
# chkconfig: 2345 09 91
|
||||
# description: Manage Open vSwitch kernel modules and user-space daemons
|
||||
|
||||
# Copyright (C) 2009, 2010, 2011 Nicira, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at:
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
### BEGIN INIT INFO
|
||||
# Provides: openvswitch-switch
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Open vSwitch switch
|
||||
### END INIT INFO
|
||||
|
||||
. /usr/share/openvswitch/scripts/ovs-lib || exit 1
|
||||
test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch
|
||||
|
||||
start () {
|
||||
set ovs_ctl ${1-start}
|
||||
set "$@" --system-id=random
|
||||
if test X"$FORCE_COREFILES" != X; then
|
||||
set "$@" --force-corefiles="$FORCE_COREFILES"
|
||||
fi
|
||||
if test X"$OVSDB_SERVER_PRIORITY" != X; then
|
||||
set "$@" --ovsdb-server-priority="$OVSDB_SERVER_PRIORITY"
|
||||
fi
|
||||
if test X"$VSWITCHD_PRIORITY" != X; then
|
||||
set "$@" --ovs-vswitchd-priority="$VSWITCHD_PRIORITY"
|
||||
fi
|
||||
if test X"$VSWITCHD_MLOCKALL" != X; then
|
||||
set "$@" --mlockall="$VSWITCHD_MLOCKALL"
|
||||
fi
|
||||
set "$@" $OVS_CTL_OPTS
|
||||
"$@"
|
||||
|
||||
ovs_ctl --protocol=gre enable-protocol
|
||||
|
||||
touch /var/lock/subsys/openvswitch
|
||||
}
|
||||
|
||||
stop () {
|
||||
ovs_ctl stop
|
||||
rm -f /var/lock/subsys/openvswitch
|
||||
}
|
||||
|
||||
restart () {
|
||||
if [ "$1" = "--save-flows=yes" ]; then
|
||||
start restart
|
||||
else
|
||||
stop
|
||||
start
|
||||
fi
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
shift
|
||||
restart "$@"
|
||||
;;
|
||||
reload|force-reload)
|
||||
# Nothing to do.
|
||||
;;
|
||||
status)
|
||||
ovs_ctl status
|
||||
;;
|
||||
version)
|
||||
ovs_ctl version
|
||||
;;
|
||||
force-reload-kmod)
|
||||
start force-reload-kmod
|
||||
;;
|
||||
help)
|
||||
printf "$0 [start|stop|restart|reload|force-reload|status|version|force-reload-kmod]\n"
|
||||
;;
|
||||
*)
|
||||
printf "Unknown command: $1\n"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
@ -1,15 +0,0 @@
|
||||
[Unit]
|
||||
Description=Open vSwitch Unit
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
After=openvswitch-nonetwork.service
|
||||
Requires=openvswitch-nonetwork.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/bin/true
|
||||
ExecStop=/bin/true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,24 +0,0 @@
|
||||
### Configuration options for openvswitch
|
||||
|
||||
# Copyright (C) 2009, 2010, 2011 Nicira, Inc.
|
||||
|
||||
# FORCE_COREFILES: If 'yes' then core files will be enabled.
|
||||
# FORCE_COREFILES=yes
|
||||
|
||||
# OVSDB_SERVER_PRIORITY: "nice" priority at which to run ovsdb-server.
|
||||
#
|
||||
# OVSDB_SERVER_PRIORITY=-10
|
||||
|
||||
# VSWITCHD_PRIORITY: "nice" priority at which to run ovs-vswitchd.
|
||||
# VSWITCHD_PRIORITY=-10
|
||||
|
||||
# VSWITCHD_MLOCKALL: Whether to pass ovs-vswitchd the --mlockall option.
|
||||
# This option should be set to "yes" or "no". The default is "yes".
|
||||
# Enabling this option can avoid networking interruptions due to
|
||||
# system memory pressure in extraordinary situations, such as multiple
|
||||
# concurrent VM import operations.
|
||||
# VSWITCHD_MLOCKALL=yes
|
||||
|
||||
# OVS_CTL_OPTS: Extra options to pass to ovs-ctl. This is, for example,
|
||||
# a suitable place to specify --ovs-vswitchd-wrapper=valgrind.
|
||||
# OVS_CTL_OPTS=
|
Loading…
Reference in new issue