summaryrefslogtreecommitdiff
path: root/debian/openvswitch-switch.init
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-07-18 13:51:12 -0700
committerBen Pfaff <blp@nicira.com>2011-07-26 10:37:28 -0700
commit9fc47ed759a82391070dfbda0e06592eb0a18391 (patch)
tree6450ed953d2779ebde9a4dbfdc08873b4b315e87 /debian/openvswitch-switch.init
parent48a695011b3dda6b68e9a07824d649aa6b8eb2ef (diff)
downloadopenvswitch-9fc47ed759a82391070dfbda0e06592eb0a18391.tar.gz
debian: Add support for bridge compatibility.
This adds support for bridge compatibility to the generic Open vSwitch init scripts and to the Debian packaging. See https://bugs.launchpad.net/ubuntu/+source/openvswitch/+bug/808224.
Diffstat (limited to 'debian/openvswitch-switch.init')
-rwxr-xr-xdebian/openvswitch-switch.init22
1 files changed, 17 insertions, 5 deletions
diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init
index 36bc20891..a9bf44391 100755
--- a/debian/openvswitch-switch.init
+++ b/debian/openvswitch-switch.init
@@ -25,22 +25,34 @@
(test -x /usr/sbin/ovs-vswitchd && test -x /usr/bin/ovsdb-server) || exit 0
+. /usr/share/openvswitch/scripts/ovs-lib.sh
test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch
-ovs_ctl=/usr/share/openvswitch/scripts/ovs-ctl
+if test X"$BRCOMPAT" = Xyes && test ! -x /usr/sbin/ovs-brcompatd; then
+ BRCOMPAT=no
+ log_warning_msg "ovs-brcompatd missing, disabling bridge compatibility"
+fi
+
+ovs_ctl () {
+ set /usr/share/openvswitch/scripts/ovs-ctl "$@"
+ if test X"$BRCOMPAT" = Xyes; then
+ set "$@" --brcompat
+ fi
+ "$@"
+}
start () {
- set $ovs_ctl ${1-start} --system-id=random
+ set ovs_ctl ${1-start} --system-id=random
if test X"$FORCE_COREFILES" != X; then
set "$@" --force-corefiles="$FORCE_COREFILES"
fi
"$@" || exit $?
- $ovs_ctl --protocol=gre enable-protocol
+ ovs_ctl --protocol=gre enable-protocol
}
stop () {
- $ovs_ctl stop
+ ovs_ctl stop
}
case $1 in
@@ -58,7 +70,7 @@ case $1 in
start
;;
status)
- $ovs_ctl status
+ ovs_ctl status
;;
force-reload-kmod)
start force-reload-kmod