- load_module openvswitch_mod
- unload_module ip_gre
- load_module ip_gre_mod
-
- if test -n "$CORE_LIMIT"; then
- check_op "Setting core limit to $CORE_LIMIT" ulimit -c "$CORE_LIMIT"
- fi
-
- # Create an empty configuration database if it doesn't exist.
- if test ! -e /etc/openvswitch-switch/conf; then
- # Create configuration database.
- ovsdb-tool -vANY:console:emer \
- create /etc/openvswitch-switch/conf \
- /usr/share/openvswitch/vswitch-idl.ovsschema
- fi
-
- if test "$ENABLE_MONITOR" = y; then
- monitor_opt=--monitor
- else
- monitor_opt=
- fi
-
- # Start ovsdb-server.
- set --
- set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err
- set -- "$@" --log-file
- set -- "$@" --detach --pidfile $monitor_opt
- set -- "$@" --remote punix:/var/run/ovsdb-server
- set -- "$@" /etc/openvswitch-switch/conf
- set -- "$@" $OVSDB_SERVER_OPTS
- echo -n "Starting ovsdb-server: "
- start-stop-daemon --start --quiet --pidfile /var/run/ovsdb-server.pid \
- --exec $ovsdb_server -- "$@"
- if running ovsdb-server; then
- echo "ovsdb-server."
- else
- echo " ERROR."
- fi
-
- ovs-vsctl --no-wait init
-
- # Start ovs-vswitchd.
- set --
- set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err
- set -- "$@" --log-file
- set -- "$@" --detach --pidfile $monitor_opt
- set -- "$@" unix:/var/run/ovsdb-server
- set -- "$@" $OVS_VSWITCHD_OPTS
- echo -n "Starting ovs-vswitchd: "
- start-stop-daemon --start --quiet --pidfile /var/run/ovs-vswitchd.pid \
- --exec $ovs_vswitchd -- "$@"
- if running ovs-vswitchd; then
- echo "ovs-vswitchd."
- else
- echo " ERROR."
- fi