/files
/nicira-switch
/openvswitch
+/openvswitch-brcompat
/openvswitch-common
/openvswitch-common.copyright
/openvswitch-controller
debian/copyright \
debian/copyright.in \
debian/dirs \
+ debian/openvswitch-brcompat.install \
+ debian/openvswitch-brcompat.manpages \
+ debian/openvswitch-brcompat.postinst \
debian/openvswitch-common.dirs \
debian/openvswitch-common.install \
debian/openvswitch-common.manpages \
.
Open vSwitch is a full-featured software-based Ethernet switch.
+Package: openvswitch-brcompat
+Architecture: linux-any
+Depends: ${shlibs:Depends}, openvswitch-switch (= ${binary:Version})
+Recommends: bridge-utils
+Description: Open vSwitch bridge compatibility support
+ openvswitch-brcompat provides a way for applications that use the
+ Linux bridge to gradually migrate to Open vSwitch. Programs that
+ ordinarily control the Linux bridge module, such as "brctl", instead
+ control the Open vSwitch kernel-based switch.
+ .
+ Once this package is installed, adding BRCOMPAT=yes in
+ /etc/default/openvswitch-switch enables bridge compatibility.
+ .
+ Open vSwitch is a full-featured software-based Ethernet switch.
+
Package: openvswitch-dbg
Section: debug
Architecture: linux-any
--- /dev/null
+_debian/vswitchd/ovs-brcompatd usr/sbin
--- /dev/null
+_debian/vswitchd/ovs-brcompatd.8
--- /dev/null
+#!/bin/sh
+
+# If openvswitch-switch is installed, and then later openvswitch-brcompat is
+# installed, make sure that ovs-brcompatd starts.
+if test X"$1" = Xconfigure && \
+ test -x /etc/init.d/openvswitch-switch && \
+ test -e /var/run/openvswitch/ovs-vswitchd.pid; then
+ invoke-rc.d openvswitch-switch start || exit $?
+fi
+
+#DEBHELPER#
+
+exit 0
+
+
(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
start
;;
status)
- $ovs_ctl status
+ ovs_ctl status
;;
force-reload-kmod)
start force-reload-kmod
# FORCE_COREFILES: If 'yes' then core files will be enabled.
# FORCE_COREFILES=yes
+
+# BRCOMPAT: If 'yes' and the openvswitch-brcompat package is installed, then
+# Linux bridge compatibility will be enabled.
+# BRCOMPAT=no
(This is because the Open vSwitch kernel module cannot coexist with
the Linux bridge module before 2.6.37.)
.
+.IP 2.
+If \fB\-\-brcompat\fR was specified, loads the Open vSwitch bridge
+compatibility module.
+.
.PP
The \fBstart\fR command skips the following steps if
\fBovsdb\-server\fR is already running:
-.IP 2.
+.IP 3.
If the Open vSwitch database file does not exist, it creates it.
If the database does exist, but it has an obsolete version, it
upgrades it to the latest schema.
.
-.IP 3.
+.IP 4.
Starts \fBovsdb-server\fR.
.
-.IP 4.
+.IP 5.
Initializes a few values inside the database.
.
-.IP 5.
+.IP 6.
If the \fB\-\-delete\-bridges\fR option was used, deletes all of the
bridges from the database.
.
.PP
The \fBstart\fR command skips the following step if
\fBovs\-vswitchd\fR is already running:
-.IP 6.
+.IP 7.
Starts \fBovs\-vswitchd\fR.
.
+.PP
+The \fBstart\fR command skips the following step if
+\fBovs\-brcompatd\fR is already running or if \fB\-\-brcompat\fR is
+not specified:
+.IP 8.
+Starts \fBovs\-brcompatd\fR.
+.
.SS "Options"
.PP
Several command-line options influence the \fBstart\fR command's
.SH "The ``stop'' command"
.
.PP
-The \fBstart\fR command shuts down Open vSwitch. If
-\fBovs\-vswitchd\fR is running, kills it and waits for it to
-terminate, then it does the same for \fBovsdb\-server\fR.
+The \fBstop\fR command shuts down Open vSwitch. It kills any running
+\fBovs\-brcompatd\fR, \fBovs\-vswitchd\fR, or \fBovsdb\-server\fR
+daemons and waits for them to terminate.
+.
+.PP
+The \fBstop\fR command does not unload the Open vSwitch kernel
+modules.
.
.PP
This command does nothing and finishes successfully if the OVS daemons
.SH "The ``status'' command"
.
.PP
-The \fBstatus\fR command checks whether the OVS daemons are running
-and prints messages with that information. It exits with status 0 if
+The \fBstatus\fR command checks whether the OVS daemons
+\fBovs-vswitchd\fR and \fBovsdb\-server\fR are running and prints
+messages with that information. If \fB\-\-brcompat\fR is specified,
+it also checks for \fBovs\-brcompatd\fR. It exits with status 0 if
the daemons are running, 1 otherwise.
.
.SH "The ``version'' command"
.
.PP
The \fBversion\fR command runs \fBovsdb\-server \-\-version\fR and
-\fBovs\-vswitchd \-\-version\fR.
+\fBovs\-vswitchd \-\-version\fR. If \fB\-\-brcompat\fR is specified,
+it also runs \fBovs\-brcompatd \-\-version\fR.
.
.SH "The ``force\-reload\-kmod'' command"
.
entries.
.
.IP 4.
-Unloads the Open vSwitch kernel module.
+Unloads the Open vSwitch kernel module (including the bridge
+compatibility module if it is loaded).
.
.IP 5.
Starts OVS back up, as if by a call to \fBovs\-ctl start\fR. This
-reloads the kernel module and restarts the OVS daemons.
+reloads the kernel module and restarts the OVS daemons (including
+\fBovs\-brcompatd\fR, if \fB\-\-brcompat\fR is specified).
.
.IP 6.
Restores the kernel configuration state that was saved in step 3.
.
Prints a usage message and exits successfully.
.
+.SH "OPTIONS"
+.PP
+In addition to the options listed for each command above, this option
+controls the behavior of several of \fBovs\-ctl\fR's commands.
+.
+.IP "\fB\-\-brcompat\fR"
+By default, \fBovs\-ctl\fR does not load the Open vSwitch bridge
+compatibility module and does not start or check the status or report
+the version of the \fBovs\-brcompatd\fR daemon. This option enables
+all of those behaviors.
+.
+.IP
+The \fBstop\fR command always stops \fBovs\-brcompatd\fR, if it is
+running, regardless of this option.
+.
.SH "EXIT STATUS"
.
\fBovs\-ctl\fR exits with status 0 on success and nonzero on failure.
.
.SH "SEE ALSO"
.
-\fBREADME\fR, \fBINSTALL.LINUX\fR, \fBovsdb\-server\fR(8),
+\fBREADME\fR, \fBINSTALL.Linux\fR, \fBovsdb\-server\fR(8),
\fBovs\-vswitchd\fR(8).
## start ##
## ----- ##
-insert_modules_if_required () {
+insert_openvswitch_mod_if_required () {
# If openvswitch_mod is already loaded then we're done.
test -e /sys/module/openvswitch_mod && return 0
action "Inserting openvswitch module" modprobe openvswitch_mod
}
+insert_brcompat_mod_if_required () {
+ test -e /sys/module/brcompat_mod && return 0
+ action "Inserting brcompat module" modprobe brcompat_mod
+}
+
ovs_vsctl () {
ovs-vsctl --no-wait --timeout=5 "$@"
}
ulimit -Sc 67108864
fi
- insert_modules_if_required || return 1
+ insert_openvswitch_mod_if_required || return 1
+ if test X"$BRCOMPAT" = Xyes; then
+ insert_brcompat_mod_if_required || return 1
+ fi
if daemon_is_running ovsdb-server; then
log_success_msg "ovsdb-server is already running"
fi
start_daemon "$OVS_VSWITCHD_PRIORITY" "$@"
fi
+
+ if daemon_is_running ovs-brcompatd; then
+ log_success_msg "ovs-brcompatd is already running"
+ elif test X"$BRCOMPAT" = Xyes; then
+ set ovs-brcompatd
+ set "$@" -vANY:CONSOLE:EMER -vANY:SYSLOG:ERR -vANY:FILE:INFO
+ start_daemon "$OVS_BRCOMPATD_PRIORITY" "$@"
+ fi
}
## ---- ##
## ---- ##
stop () {
+ stop_daemon ovs-brcompatd
stop_daemon ovs-vswitchd
stop_daemon ovsdb-server
}
action "Removing datapath: $dp" ovs-dpctl del-dp "$dp"
done
+ if test -e /sys/module/brcompat_mod; then
+ action "Removing brcompat module" rmmod brcompat_mod
+ fi
if test -e /sys/module/openvswitch_mod; then
action "Removing openvswitch module" rmmod openvswitch_mod
fi
SYSTEM_ID=
DELETE_BRIDGES=no
+ BRCOMPAT=no
DAEMON_CWD=/
FORCE_COREFILES=yes
MLOCKALL=yes
OVSDB_SERVER_PRIORITY=-10
OVS_VSWITCHD_PRIORITY=-10
+ OVS_BRCOMPATD_PRIORITY=-10
DB_FILE=$etcdir/conf.db
DB_SOCK=$rundir/db.sock
enable-protocol enable protocol specified in options with iptables
help display this help message
-One of the following options should be specified when starting Open vSwitch:
+One of the following options is required for "start" and "force-reload-kmod":
--system-id=UUID set specific ID to uniquely identify this system
--system-id=random use a random but persistent UUID to identify this system
-Other important options for starting Open vSwitch:
+Other important options for "start" and "force-reload-kmod":
--system-type=TYPE set system type (e.g. "XenServer")
--system-version=VERSION set system version (e.g. "5.6.100-39265p")
--external-id="key=value"
add given key-value pair to Open_vSwitch external-ids
--delete-bridges delete all bridges just before starting ovs-vswitchd
-Less important options for starting Open vSwitch:
- --daemon-cwd=DIR current working directory for OVS daemons (default: $DAEMON_CWD)
- --no-force-corefiles
- do not forcibly enable core dumps for OVS daemons
- --no-mlockall do not lock all of ovs-vswitchd into memory
- --ovsdb-server-priority=NICE
- set ovsdb-server's niceness (default: $OVSDB_SERVER_PRIORITY)
- --ovs-vswitchd-priority=NICE
- set ovs-vswitchd's niceness (default: $OVS_VSWITCHD_PRIORITY)
+Less important options for "start" and "force-reload-kmod":
+ --daemon-cwd=DIR set working dir for OVS daemons (default: $DAEMON_CWD)
+ --no-force-corefiles do not force on core dumps for OVS daemons
+ --no-mlockall do not lock all of ovs-vswitchd into memory
+ --ovsdb-server-priority=NICE set ovsdb-server's niceness (default: $OVSDB_SERVER_PRIORITY)
+ --ovs-vswitchd-priority=NICE set ovs-vswitchd's niceness (default: $OVS_VSWITCHD_PRIORITY)
+ --ovs-brcompatd-priority=NICE set ovs-brcompatd's niceness (default: $OVS_BRCOMPATD_PRIORITY)
+
+Options for "start", "force-reload-kmod", "status", and "version":
+ --brcompat enable Linux bridge compatibility module and daemon
File location options:
--db-file=FILE database file name (default: $DB_FILE)
--db-sock=SOCKET JSON-RPC socket name (default: $DB_SOCK)
--db-schema=FILE database schema file name (default: $DB_SCHEMA)
-Options for enable-protocol:
+Options for "enable-protocol":
--protocol=PROTOCOL protocol to enable with iptables (default: gre)
--sport=PORT source port to match (for tcp or udp protocol)
--dport=PORT ddestination port to match (for tcp or udp protocol)
eval $var=\$value
}
+daemons () {
+ echo ovsdb-server ovs-vswitchd
+ if test X"$BRCOMPAT" = Xyes; then
+ echo ovs-brcompatd
+ fi
+}
+
set_defaults
extra_ids=
command=
stop
;;
status)
- daemon_status ovsdb-server && daemon_status ovs-vswitchd
+ rc=0
+ for daemon in `daemons`; do
+ daemon_status $daemon || rc=$?
+ done
+ exit $rc
;;
version)
- ovsdb-server --version && ovs-vswitchd --version
+ for daemon in `daemons`; do
+ $daemon --version
+ done
;;
force-reload-kmod)
force_reload_kmod