Commit 27e4f77f authored by iv's avatar iv

gitlab: watcher should take care of sidekiq killed by SIGTERM

The watcher should also watch for signals like SIGTERM killing sidekiq, which
are trapped by sidekiq, with sidekiq exiting successfully (with exit code 0).

Discussion: https://lab.nexedi.com/lab.nexedi.com/lab.nexedi.com/issues/25#note_22085
parent 5f488f42
......@@ -269,7 +269,7 @@ context =
[watcher-sigkill]
<= binsh
md5sum = 2986dcb006dc9e8508ff81f646656131
md5sum = 9233f3726a8e7ee39cdfefa10d839c62
[gitlab-export]
<= binsh
......
......@@ -12,6 +12,7 @@ fi
prog="$@"
progpid=""
exitok="0" # sidekiq traps some signals (SIGTERM, ...) and exits with code 0
killexit="137" # = 128 + 9 (exit code of process terminated by SIGKILL)
# make sure to terminate children, when we exit.
......@@ -33,7 +34,7 @@ while true; do
echo "-> $status"
# if program terminated not by SIGKILL - exit
if [ "$status" != "$killexit" ] ; then
if [[ "$status" != "$killexit" && "$status" != "$exitok" ]] ; then
echo "exit $status"
exit "$status"
fi
......
Markdown is supported
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