From 5c45b19273039df53fba240852db0b0c3aff3a98 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Mon, 17 Apr 2017 18:22:18 -0400 Subject: [PATCH] Avoid running more than one etcd process If both Fuxi and Kuryr-libnetwork are enabled in devstack, the script will fail since etcd-server was spawned twice. This commit added a check for existing etcd process and spawn one if not existed. Closes-Bug: #1683852 Change-Id: Iecef71df1c0b58db62c20462932ba179c91a1695 --- devstack/plugin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 03a83efc..19a4493f 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -116,7 +116,7 @@ if is_service_enabled kuryr-libnetwork; then configure_kuryr "${DISTRO_DISTUTILS_DATA_PATH}" # Run etcd first - run_process etcd-server "$DEST/etcd/etcd-$ETCD_VERSION-linux-amd64/etcd --data-dir $DEST/etcd/db.etcd --advertise-client-urls http://0.0.0.0:$KURYR_ETCD_PORT --listen-client-urls http://0.0.0.0:$KURYR_ETCD_PORT" + pgrep -x "etcd" >/dev/null || run_process etcd-server "$DEST/etcd/etcd-$ETCD_VERSION-linux-amd64/etcd --data-dir $DEST/etcd/db.etcd --advertise-client-urls http://0.0.0.0:$KURYR_ETCD_PORT --listen-client-urls http://0.0.0.0:$KURYR_ETCD_PORT" # FIXME(mestery): By default, Ubuntu ships with /bin/sh pointing to # the dash shell.