summaryrefslogtreecommitdiff
path: root/lib/load-configuration
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-06-21 15:46:00 +0200
committerErich Eckner <git@eckner.net>2018-06-21 15:46:00 +0200
commit95257cf93eb1c21fd70023913c226636f4e467bb (patch)
tree25dc06bdcb2e8a6b72f82f21c9040ea10db32bb6 /lib/load-configuration
parente93ab1f0ed0ef76624a3d44d828b58149d1322da (diff)
downloadbuilder-95257cf93eb1c21fd70023913c226636f4e467bb.tar.xz
lib/load-configuration: source lib/mysql-functions depending on wether mysqld is running or not, not on wether we're the master or not
Diffstat (limited to 'lib/load-configuration')
-rwxr-xr-xlib/load-configuration7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/load-configuration b/lib/load-configuration
index 80b8de4..7a6a4f3 100755
--- a/lib/load-configuration
+++ b/lib/load-configuration
@@ -22,10 +22,13 @@ work_dir="${base_dir}/work"
# if mysqld is not running, we're either on a build slave and don't need
# lib/mysql-functions or we're on the build master and something is wrong
# anyway
-if [ "$(hostname)" = 'buildmaster.archlinux32.org' ]; then
- i_am_the_master=true
+if pgrep -x mysqld >/dev/null 2>&1; then
# shellcheck source=../lib/mysql-functions
. "${base_dir}/lib/mysql-functions"
+fi
+
+if [ "$(hostname)" = 'buildmaster.archlinux32.org' ]; then
+ i_am_the_master=true
else
i_am_the_master=false