diff options
| author | digambar <digambarpatil15@yahoo.co.in> | 2015-07-03 12:09:46 +0530 |
|---|---|---|
| committer | Swapnil Kulkarni <me@coolsvap.net> | 2015-07-09 12:15:18 -0400 |
| commit | d2d3e74e193b2ec5bdda8029b75218a10435a9a4 (patch) | |
| tree | 593ef9232dcd73ae9ed9699591442a1896608da3 /docker/common/openvswitch | |
| parent | fcda6a06d8eee9d3f3199962b36a04a8c702072c (diff) | |
| download | kolla-d2d3e74e193b2ec5bdda8029b75218a10435a9a4.tar.gz kolla-d2d3e74e193b2ec5bdda8029b75218a10435a9a4.zip | |
Add config-internal/config-external to OpenvSwitch containers
Partially Implements: Blueprint standard-start
Co-Authored-By: Swapnil Kulkarni <me@coolsvap.net>
Change-Id: I52ed4b56efe3fc4ebbc108b2fe7e9d69eb0f0928
Diffstat (limited to 'docker/common/openvswitch')
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 |
