Improve signal handling for logrotate, unicorn wrapper
In sv-xxx-run shell scripts we have a problem with signal handling. When the script calls sleep
, any signal sent to the script is delayed until after sleep finishes.
Joe suggested to us to put sleep
in the background and call wait
:
sleep 10 &
wait
Another potential solution, which would not leave an orphan sleep
, would be to put the actual script in a separate file myscript
, and call chpst -P myscript
in sv-XXX_run. Then myscript runs in a separate process group, and MAYBE runit will then signal the process group.