aboutsummaryrefslogtreecommitdiff
path: root/docker/common/openvswitch/ovs-db-server
diff options
context:
space:
mode:
Diffstat (limited to 'docker/common/openvswitch/ovs-db-server')
-rw-r--r--docker/common/openvswitch/ovs-db-server/config-external.sh3
-rw-r--r--docker/common/openvswitch/ovs-db-server/config-internal.sh16
-rwxr-xr-xdocker/common/openvswitch/ovs-db-server/start.sh11
3 files changed, 29 insertions, 1 deletions
diff --git a/docker/common/openvswitch/ovs-db-server/config-external.sh b/docker/common/openvswitch/ovs-db-server/config-external.sh
new file mode 100644
index 000000000..9ada4efcb
--- /dev/null
+++ b/docker/common/openvswitch/ovs-db-server/config-external.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+#This file should be a noop. It just needs to exist, but it don't perform any function
diff --git a/docker/common/openvswitch/ovs-db-server/config-internal.sh b/docker/common/openvswitch/ovs-db-server/config-internal.sh
new file mode 100644
index 000000000..a2b4d6c8f
--- /dev/null
+++ b/docker/common/openvswitch/ovs-db-server/config-internal.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -o errexit
+
+LOG_FILE="/var/log/openvswitch/ovsdb-server.log"
+DB_FILE="/etc/openvswitch/conf.db"
+UNIXSOCK_DIR="/var/run/openvswitch"
+UNIXSOCK="${UNIXSOCK_DIR}/db.sock"
+
+mkdir -p "${UNIXSOCK_DIR}"
+
+if [[ ! -e "${DB_FILE}" ]]; then
+ ovsdb-tool create "${DB_FILE}"
+fi
+
+exec ovsdb-server $DB_FILE -vconsole:emer -vsyslog:err -vfile:info --remote=punix:"${UNIXSOCK}" --log-file="${LOG_FILE}"
diff --git a/docker/common/openvswitch/ovs-db-server/start.sh b/docker/common/openvswitch/ovs-db-server/start.sh
index a2b4d6c8f..ae87da4e2 100755
--- a/docker/common/openvswitch/ovs-db-server/start.sh
+++ b/docker/common/openvswitch/ovs-db-server/start.sh
@@ -7,10 +7,19 @@ DB_FILE="/etc/openvswitch/conf.db"
UNIXSOCK_DIR="/var/run/openvswitch"
UNIXSOCK="${UNIXSOCK_DIR}/db.sock"
+CMD="/usr/sbin/ovsdb-server"
+ARGS="$DB_FILE -vconsole:emer -vsyslog:err -vfile:info --remote=punix:${UNIXSOCK} --log-file=${LOG_FILE}"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Config-internal script exec out of this function, it does not return here.
+set_configs
+
mkdir -p "${UNIXSOCK_DIR}"
if [[ ! -e "${DB_FILE}" ]]; then
ovsdb-tool create "${DB_FILE}"
fi
-exec ovsdb-server $DB_FILE -vconsole:emer -vsyslog:err -vfile:info --remote=punix:"${UNIXSOCK}" --log-file="${LOG_FILE}"
+exec $CMD $ARGS