unset OVSDB_SERVER_OPTS
unset OVS_VSWITCHD_OPTS
unset CORE_LIMIT
+unset ENABLE_MONITOR
default=/etc/default/openvswitch-switch
if [ -f $default ] ; then
. $default
fi
+: ${ENABLE_MONITOR:=y}
+
set -e
# running_pid pid name
fi
# Create an empty configuration database if it doesn't exist.
- if test ! -e /etc/openvswitch-switch/conf; then
+ if test ! -e /etc/openvswitch/conf.db; then
# Create configuration database.
ovsdb-tool -vANY:console:emer \
create /etc/openvswitch-switch/conf \
- /usr/share/openvswitch/vswitch-idl.ovsschema
+ /usr/share/openvswitch/vswitch.ovsschema
+ else
+ # Upgrade or downgrade schema and compact database.
+ ovsdb-tool -vANY:console:emer \
+ convert /etc/openvswitch-switch/conf \
+ /usr/share/openvswitch/vswitch.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
+ set -- "$@" --detach --pidfile $monitor_opt
set -- "$@" --remote punix:/var/run/ovsdb-server
set -- "$@" /etc/openvswitch-switch/conf
+ set -- "$@" --private-key=db:SSL,private_key
+ set -- "$@" --certificate=db:SSL,certificate
+ set -- "$@" --bootstrap-ca-cert=db:SSL,ca_cert
set -- "$@" $OVSDB_SERVER_OPTS
echo -n "Starting ovsdb-server: "
start-stop-daemon --start --quiet --pidfile /var/run/ovsdb-server.pid \
set --
set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err
set -- "$@" --log-file
- set -- "$@" --detach --pidfile
+ set -- "$@" --detach --pidfile $monitor_opt
set -- "$@" unix:/var/run/ovsdb-server
set -- "$@" $OVS_VSWITCHD_OPTS
echo -n "Starting ovs-vswitchd: "