From 3225570530458956fd642fa06b83360a7e4e2e61 Mon Sep 17 00:00:00 2001 From: Mihnea Saracin Date: Thu, 20 May 2021 14:33:58 +0300 Subject: [PATCH] Execute once the ceph services script on AIO The MTC client manages ceph services via ceph.sh which is installed on all node types in /etc/service.d/{controller,worker,storage}/ceph.sh Since the AIO controllers have both controller and worker personalities, the MTC client will execute the ceph script twice (/etc/service.d/worker/ceph.sh, /etc/service.d/controller/ceph.sh). This behavior will generate some issues. We fix this by exiting the ceph script if it is the one from /etc/services.d/worker on AIO systems. Closes-Bug: 1928934 Change-Id: I3e4dc313cc3764f870b8f6c640a6033822639926 Signed-off-by: Mihnea Saracin --- ceph/ceph/files/ceph.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ceph/ceph/files/ceph.sh b/ceph/ceph/files/ceph.sh index e7e6ecd1f..53e5a114a 100644 --- a/ceph/ceph/files/ceph.sh +++ b/ceph/ceph/files/ceph.sh @@ -48,6 +48,17 @@ stop () RC=$? } +# If system is an AIO the mtcClient will run this script twice +# from 2 locations and this generates some errors. +# So we have to exit the script if is called +# from /etc/services.d/worker in order to be executed once +if [[ "$system_type" == "All-in-one" ]]; then + dir_path=$(dirname "$(realpath $0)") + if [[ "$dir_path" == "/etc/services.d/worker" ]]; then + exit 0 + fi +fi + RC=0 case "$1" in