Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2019-11-23 15:58:56 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2019-11-23 15:58:56 +0100
commit2b25805e7b1e570cd31cd94d0f4a4d075d4a22a2 (patch)
treed5b03ecc237be0ad3f60137a5e8ea0536d7e93ad
parent8510c3276e98b7d6b4ddeddf099c013f088898f2 (diff)
make stop slave switch also work in multi-slave mode
-rwxr-xr-xbin/build-packages6
-rwxr-xr-xlib/load-configuration5
2 files changed, 9 insertions, 2 deletions
diff --git a/bin/build-packages b/bin/build-packages
index 16521c9..be6bf16 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -1105,4 +1105,10 @@ while [ "${count}" -ne 0 ] && \
done
+# remove the slave switch file if it exists (and if we are runnig on a slave)
+if ! ${i_am_the_master}; then
+ SLAVE=$(whoami)
+ [ -f "/tmp/do-not-run-build-slave.$SLAVE" ] && rm "/tmp/do-not-run-build-slave.$SLAVE"
+fi
+
>&2 echo 'Done.'
diff --git a/lib/load-configuration b/lib/load-configuration
index a6db76e..2a8f08c 100755
--- a/lib/load-configuration
+++ b/lib/load-configuration
@@ -33,13 +33,14 @@ else
# is active. Remove the kill switch and return non-zero exit state,
# effectively making systemd not restart the service
- if [ -f '/tmp/do-not-run-build-slave' ]; then
+ SLAVE=$(whoami)
+ if [ -f "/tmp/do-not-run-build-slave.$SLAVE" ]; then
>&2 echo "Build slave stop switch is ative.. I'll stop now."
# When the buildslave is on "stop-now",
# - systemd 'Restart' expects non-zero exit code
# - interactively run commands SHOULD get exit code 1, too
# - remove the switch file, so we can start the service again
- [ -f '/tmp/do-not-run-build-slave' ] && rm '/tmp/do-not-run-build-slave'
+ [ -f "/tmp/do-not-run-build-slave.$SLAVE" ] && rm "/tmp/do-not-run-build-slave.$SLAVE"
exit 1
fi
fi