procServ
procServ copied to clipboard
child process cannot be terminated with SIGTERM
Since V6.6.1, to be exact since commit 291c7a08b342e6df134d40bd996543fd41fd1a5f "Make signal handling safe using pselect.", the child process started by procServ cannot be terminated with SIGTERM any longer. In particular --killsig 15 does not work.
The reason is probably that the child inherits the signal mask which blocks SIGTERM (and SIGPIPE and SIGHUP).
Signal mask should be reset to "normal" for the child.
+1
man sigprocmask:
A child created via fork(2) inherits a copy of its parent's signal mask; the signal mask is preserved across execve(2).
Argh, only half the job... Need to handle SIG_IGN as well.
I replaced ignoring signals by blocking signals so that signals can be restored easier in the child process.
Should I put the fix for the annoying SigPipe message #43 into this branch, too?
I would also like to clean up spaces and tabs.