Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-10-29 07:43:48 +0100
committerErich Eckner <git@eckner.net>2019-10-29 07:43:48 +0100
commitf015c817f3e7c300b8eb83546b05a8d2e4993af5 (patch)
treebe8cf37e473bde461323726be899ff980166d4e3 /lib
parent7965fc949fb2994d2646c58aa640e5a1dae62aba (diff)
lib/load-configuration: `exit 0` for systemd if buildmaster is on halt
Diffstat (limited to 'lib')
-rwxr-xr-xlib/load-configuration10
1 files changed, 9 insertions, 1 deletions
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