From addd5187f766943b3164f45e61258410cd2872d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20=C5=9Awi=C4=85tek?= Date: Tue, 5 Dec 2023 23:25:48 +0100 Subject: [PATCH] fix(install): fail install if Otelcol is not running on darwin --- scripts/install.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 8085de3bac..27c9471a3c 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1931,6 +1931,13 @@ if [[ "${OS_TYPE}" == "darwin" ]]; then launchctl unload "${LAUNCHD_CONFIG}" launchctl load -w "${LAUNCHD_CONFIG}" + echo 'Waiting 10s before checking status' + sleep 10 + if ! launchctl print system/otelcol-sumo | grep "state = running"; then + echo "Failed to launch otelcol" + tail /var/log/otelcol-sumo/otelcol-sumo.log + exit 1 + fi exit 0 fi @@ -2127,4 +2134,9 @@ systemctl restart otelcol-sumo echo 'Waiting 10s before checking status' sleep 10 -systemctl status otelcol-sumo --no-pager +if ! systemctl status otelcol-sumo --no-pager; then + echo "Failed to launch otelcol" + exit 1 +fi + +exit 0