Verified Commit ee2749b6 authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

reproducible debian: build service exist the whole service when the lockfile...


reproducible debian: build service exist the whole service when the lockfile appears, not just the workers

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 7688d82d
...@@ -232,10 +232,29 @@ startup_workers() { ...@@ -232,10 +232,29 @@ startup_workers() {
done done
} }
check_lock() {
LOCKFILE="/var/lib/jenkins/NO-RB-BUILDERS-PLEASE"
if [ -f "$LOCKFILE" ]; then
echo "The lockfile $LOCKFILE is present, exiting the service..."
while : ; do
children="$(pgre --list-full --parent $$)"
if [ -n "$children" ]; then
echo "There are still some child processes, waiting for them:"
echo "$children"
sleep 15m
else
exit 9
fi
done
fi
}
# #
# main, keep running forever… # main, keep running forever…
# #
while true ; do while true ; do
check_lock
# #
# this is all we do # this is all we do
# #
......
...@@ -5,6 +5,8 @@ ConditionPathExists=!/var/lib/jenkins/NO-RB-BUILDERS-PLEASE ...@@ -5,6 +5,8 @@ ConditionPathExists=!/var/lib/jenkins/NO-RB-BUILDERS-PLEASE
[Service] [Service]
# Restart whenever the script exits, without rate limiting: # Restart whenever the script exits, without rate limiting:
Restart=always Restart=always
# special code from _build_service for when NO-RB-BUILDERS-PLEASE exists, to properly quit
RestartPreventExitStatus=9
StartLimitInterval=0 StartLimitInterval=0
User=jenkins User=jenkins
Group=jenkins Group=jenkins
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment