diff options
Diffstat (limited to 'docker/common')
6 files changed, 58 insertions, 7 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 diff --git a/docker/common/openvswitch/ovs-vswitchd/config-external.sh b/docker/common/openvswitch/ovs-vswitchd/config-external.sh new file mode 100644 index 000000000..9ada4efcb --- /dev/null +++ b/docker/common/openvswitch/ovs-vswitchd/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-vswitchd/config-internal.sh b/docker/common/openvswitch/ovs-vswitchd/config-internal.sh new file mode 100644 index 000000000..1a18ab958 --- /dev/null +++ b/docker/common/openvswitch/ovs-vswitchd/config-internal.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -o errexit + +modprobe openvswitch + +LOG_FILE="/var/log/openvswitch/ovs-vswitchd.log" +DB_FILE="/etc/openvswitch/conf.db" +UNIXSOCK_DIR="/var/run/openvswitch" +UNIXSOCK="${UNIXSOCK_DIR}/db.sock" + +mkdir -p "${UNIXSOCK_DIR}" + +exec ovs-vswitchd unix:"${UNIXSOCK}" -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file="${LOG_FILE}" + diff --git a/docker/common/openvswitch/ovs-vswitchd/start.sh b/docker/common/openvswitch/ovs-vswitchd/start.sh index 5ed1fbe75..148ad5b56 100755 --- a/docker/common/openvswitch/ovs-vswitchd/start.sh +++ b/docker/common/openvswitch/ovs-vswitchd/start.sh @@ -1,14 +1,19 @@ #!/bin/bash - -set -o errexit - -modprobe openvswitch - LOG_FILE="/var/log/openvswitch/ovs-vswitchd.log" DB_FILE="/etc/openvswitch/conf.db" UNIXSOCK_DIR="/var/run/openvswitch" UNIXSOCK="${UNIXSOCK_DIR}/db.sock" +CMD="/usr/sbin/ovs-vswitchd" +ARGS="unix:${UNIXSOCK} -vconsole:emer -vsyslog:err -vfile:info --mlockall --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 + +modprobe openvswitch mkdir -p "${UNIXSOCK_DIR}" -exec ovs-vswitchd unix:"${UNIXSOCK}" -vconsole:emer -vsyslog:err -vfile:info --mlockall --log-file="${LOG_FILE}" +exec $CMD $ARGS |
