From f015c817f3e7c300b8eb83546b05a8d2e4993af5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 29 Oct 2019 07:43:48 +0100 Subject: lib/load-configuration: `exit 0` for systemd if buildmaster is on halt --- lib/load-configuration | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/load-configuration') diff --git a/lib/load-configuration b/lib/load-configuration index f20dc2d..05ec7d0 100755 --- a/lib/load-configuration +++ b/lib/load-configuration @@ -16,7 +16,15 @@ if [ "$(hostname)" = 'buildmaster.archlinux32.org' ]; then [ -f '/tmp/do-not-run-build-master' ]; then >&2 echo 'mysqld is not running or build master is on halt' >&2 echo 'I will abort - whatever you try to do would probably fail anyway.' - exit 1 + # When the buildmaster is on halt, + # - systemd MUST NOT hickup - e.g. exit code 0, + # - connecting slaves MUST get exit code 1 and + # - interactively run commands SHOULD get exit code 1, too + if tty -s && [ -z "${SSH_ORIGINAL_COMMAND}" ]; then + exit 1 + else + exit 0 + fi fi else i_am_the_master=false -- cgit v1.2.3