fi
# If openvswitch is already loaded then we're done.
- test -e /sys/module/openvswitch -o -e /sys/module/openvswitch_mod && \
- return 0
+ test -e /sys/module/openvswitch && return 0
# Load openvswitch. If that's successful then we're done.
insert_mods && return 0
esac
set "$@" external-ids:system-id="\"$SYSTEM_ID\""
+ set "$@" external-ids:hostname="\"$(hostname)\""
+
if test X"$SYSTEM_TYPE" != X; then
set "$@" system-type="\"$SYSTEM_TYPE\""
else
done
}
-start_ovsdb () {
+do_start_ovsdb () {
check_force_cores
if daemon_is_running ovsdb-server; then
fi
}
+start_ovsdb() {
+ if test X"$OVSDB_SERVER" = Xyes; then
+ do_start_ovsdb
+ fi
+}
+
add_managers () {
# Now that ovs-vswitchd has started and completed its initial
# configuration, tell ovsdb-server to conenct to the remote managers. We
# churn in the database at startup or restart. (For example, managers
# won't briefly see empty datapath-id or ofport columns for records that
# exist at startup.)
- action "Enabling remote OVSDB managers" \
- ovs-appctl -t ovsdb-server ovsdb-server/add-remote \
- db:Open_vSwitch,Open_vSwitch,manager_options
+ if test X"$OVSDB_SERVER" = Xyes || test X"$OVS_VSWITCHD" = Xyes; then
+ if daemon_is_running ovsdb-server \
+ && daemon_is_running ovs-vswitchd; then
+ action "Enabling remote OVSDB managers" \
+ ovs-appctl -t ovsdb-server ovsdb-server/add-remote \
+ db:Open_vSwitch,Open_vSwitch,manager_options
+ fi
+ fi
}
-start_forwarding () {
+do_start_forwarding () {
check_force_cores
insert_mod_if_required || return 1
fi
}
+start_forwarding () {
+ if test X"$OVS_VSWITCHD" = Xyes; then
+ do_start_forwarding
+ fi
+}
+
## ---- ##
## stop ##
## ---- ##
stop_ovsdb () {
- stop_daemon ovsdb-server
+ if test X"$OVSDB_SERVER" = Xyes; then
+ stop_daemon ovsdb-server
+ fi
}
stop_forwarding () {
- stop_daemon ovs-vswitchd
+ if test X"$OVS_VSWITCHD" = Xyes; then
+ stop_daemon ovs-vswitchd
+ fi
}
## ----------------- ##
}
flow_restore_wait () {
- ovs_vsctl set open_vswitch . other_config:flow-restore-wait="true"
+ if test X"$OVS_VSWITCHD" = Xyes; then
+ ovs_vsctl set open_vswitch . other_config:flow-restore-wait="true"
+ fi
}
flow_restore_complete () {
- ovs_vsctl --if-exists remove open_vswitch . other_config \
- flow-restore-wait="true"
+ if test X"$OVS_VSWITCHD" = Xyes; then
+ ovs_vsctl --if-exists remove open_vswitch . other_config \
+ flow-restore-wait="true"
+ fi
}
restore_flows () {
}
force_reload_kmod () {
+
+ if test X"$OVS_VSWITCHD" != Xyes; then
+ log_failure_msg "Reloading of kmod without ovs-vswitchd is an error"
+ exit 1
+ fi
+
ifaces=`internal_interfaces`
action "Detected internal interfaces: $ifaces" true
fi
done
- # try both old and new names in case this is post upgrade
- if test -e /sys/module/openvswitch_mod; then
- action "Removing openvswitch module" rmmod openvswitch_mod
- elif test -e /sys/module/openvswitch; then
+ if test -e /sys/module/openvswitch; then
action "Removing openvswitch module" rmmod openvswitch
fi
restart () {
if daemon_is_running ovsdb-server && daemon_is_running ovs-vswitchd; then
init_restore_scripts
- save_flows_if_required
+ if test X"$OVS_VSWITCHD" = Xyes; then
+ save_flows_if_required
+ fi
fi
# Restart the database first, since a large database may take a
DAEMON_CWD=/
FORCE_COREFILES=yes
MLOCKALL=yes
+ OVSDB_SERVER=yes
+ OVS_VSWITCHD=yes
OVSDB_SERVER_PRIORITY=-10
OVS_VSWITCHD_PRIORITY=-10
OVSDB_SERVER_WRAPPER=