#! /bin/sh
-# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc.
+# Copyright (C) 2009, 2010, 2011, 2012 Nicira Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
*/*) dir0=`echo "$0" | sed 's,/[^/]*$,,'` ;;
*) dir0=./ ;;
esac
-. "$dir0/ovs-lib.sh" || exit 1
+. "$dir0/ovs-lib" || exit 1
for dir in "$sbindir" "$bindir" /sbin /bin /usr/sbin /usr/bin; do
case :$PATH: in
action "Inserting brcompat module" modprobe brcompat_mod
}
+insert_mod_if_required () {
+ insert_openvswitch_mod_if_required || return 1
+ if test X"$BRCOMPAT" = Xyes; then
+ insert_brcompat_mod_if_required || return 1
+ fi
+}
+
ovs_vsctl () {
ovs-vsctl --no-wait --timeout=5 "$@"
}
ovsdb_tool () {
- ovsdb-tool -vANY:console:emer "$@"
+ ovsdb-tool -vANY:console:off "$@"
}
create_db () {
ulimit -Sc 67108864
fi
- insert_openvswitch_mod_if_required || return 1
- if test X"$BRCOMPAT" = Xyes; then
- insert_brcompat_mod_if_required || return 1
- fi
+ insert_mod_if_required || return 1
if daemon_is_running ovsdb-server; then
log_success_msg "ovsdb-server is already running"
if daemon_is_running ovs-vswitchd; then
log_success_msg "ovs-vswitchd is already running"
else
- # Increase the limit on the number of open file descriptors since
- # ovs-vswitchd needs a few per bridge
- ulimit -n 4096
+ # Increase the limit on the number of open file descriptors.
+ # ovs-vswitchd needs 16 per datapath, plus a few extra, so this
+ # should allow for 256 (or more) bridges.
+ ulimit -n 5000
# Start ovs-vswitchd.
set ovs-vswitchd unix:"$DB_SOCK"
DPORT=
SPORT=
- if (lsb_release --id) >/dev/null 2>&1; then
+ type_file=$etcdir/system-type.conf
+ version_file=$etcdir/system-version.conf
+
+ if test -e "$type_file" ; then
+ SYSTEM_TYPE=`cat $type_file`
+ SYSTEM_VERSION=`cat $version_file`
+ elif (lsb_release --id) >/dev/null 2>&1; then
SYSTEM_TYPE=`lsb_release --id -s`
system_release=`lsb_release --release -s`
system_codename=`lsb_release --codename -s`
stop stop Open vSwitch daemons
status check whether Open vSwitch daemons are running
version print versions of Open vSwitch daemons
+ load-kmod insert modules if not already present
force-reload-kmod save OVS network device state, stop OVS, unload kernel
module, reload kernel module, start OVS, restore state
enable-protocol enable protocol specified in options with iptables
--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":
+Options for "start", "force-reload-kmod", "load-kmod", "status", and "version":
--brcompat enable Linux bridge compatibility module and daemon
File location options:
force-reload-kmod)
force_reload_kmod
;;
+ load-kmod)
+ insert_mod_if_required
+ ;;
enable-protocol)
enable_protocol
;;