action "Configuring Open vSwitch system IDs" "$@" $extra_ids
}
-start () {
+check_force_cores () {
if test X"$FORCE_COREFILES" = Xyes; then
ulimit -Sc 67108864
fi
+}
- insert_mod_if_required || return 1
+start_ovsdb () {
+ check_force_cores
if daemon_is_running ovsdb-server; then
log_success_msg "ovsdb-server is already running"
done
fi
fi
+}
+
+start_forwarding () {
+ check_force_cores
+
+ insert_mod_if_required || return 1
if daemon_is_running ovs-vswitchd; then
log_success_msg "ovs-vswitchd is already running"
## stop ##
## ---- ##
-stop () {
+stop_ovsdb () {
+ stop_daemon ovsdb-server
+}
+
+stop_forwarding () {
stop_daemon ovs-brcompatd
stop_daemon ovs-vswitchd
- stop_daemon ovsdb-server
}
## ----------------- ##
ifaces=`internal_interfaces`
action "Detected internal interfaces: $ifaces" true
- stop
+ # Restart the database first, since a large database may take a
+ # while to load, and we want to minimize forwarding disruption.
+ stop_ovsdb
+ start_ovsdb
+
+ stop_forwarding
script=`mktemp`
trap 'rm -f "$script"' 0 1 2 13 15
:
else
log_warning_msg "Failed to save configuration, not replacing kernel module"
- start
+ start_forwarding
exit 1
fi
chmod +x "$script"
action "Removing openvswitch module" rmmod openvswitch
fi
- start
+ start_forwarding
action "Restoring interface configuration" "$script"
rc=$?
OVS_VSWITCHD_WRAPPER=
OVS_BRCOMPATD_WRAPPER=
- DB_FILE=$etcdir/conf.db
+ DB_FILE=$dbdir/conf.db
DB_SOCK=$rundir/db.sock
DB_SCHEMA=$datadir/vswitch.ovsschema
-V, --version display version information
Default directories with "configure" option and environment variable override:
- logs: @LOGDIR@ (--log-dir, OVS_LOGDIR)
- pidfiles and sockets: @RUNDIR@ (--run-dir, OVS_RUNDIR)
+ logs: @LOGDIR@ (--with-logdir, OVS_LOGDIR)
+ pidfiles and sockets: @RUNDIR@ (--with-rundir, OVS_RUNDIR)
+ conf.db: @DBDIR@ (--with-dbdir, OVS_DBDIR)
system configuration: @sysconfdir@ (--sysconfdir, OVS_SYSCONFDIR)
data files: @pkgdatadir@ (--pkgdatadir, OVS_PKGDATADIR)
user binaries: @bindir@ (--bindir, OVS_BINDIR)
done
case $command in
start)
- start
+ start_ovsdb
+ start_forwarding
;;
stop)
- stop
+ stop_forwarding
+ stop_ovsdb
;;
status)
rc=0