summaryrefslogtreecommitdiff
path: root/lib/load-configuration
diff options
context:
space:
mode:
Diffstat (limited to 'lib/load-configuration')
-rwxr-xr-xlib/load-configuration12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/load-configuration b/lib/load-configuration
index 9199281..a2ba0e0 100755
--- a/lib/load-configuration
+++ b/lib/load-configuration
@@ -4,9 +4,6 @@
# shellcheck disable=SC2034
-# TODO: a global kill-switch would be nice to block all activity before
-# a reboot
-
set -e
export LANG=C
@@ -33,6 +30,15 @@ fi
if [ "$(hostname)" = 'buildmaster.archlinux32.org' ]; then
i_am_the_master=true
+ # abort early if mysqld is not running or kill switch active
+ # ('/tmp/do-not-run-build-master')
+ if [ ! -S '/var/run/mysqld/mysqld.sock' ] || \
+ [ -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
+ fi
+
releng_directory="${work_dir}/repos/releng"
else
i_am_the_master=false