<div dir="ltr">Hi,<div><br></div><div>In fork mode, sending a sigterm signal to a child is caught by the parent. I suspect it has something to do with signal_pipe being shared by the child and parent after the fork.</div><div><br></div><div>Here I sent a signal to the parent while a child process was also running. The parent shut down as expected. After sending sigterm, the child remains.<br></div><div><br></div><div>Processes before sigterm: </div><div><br></div><div><div>UID Â  Â  Â  Â PID Â PPID Â C STIME TTY Â  Â  Â STAT Â  TIME CMD</div><div>user Â  Â  Â 1423 Â  Â  1 Â 0 10:32 ? Â  Â  Â  Â Ss Â  Â  0:00 /usr/local/stunnel/bin/stunnel.bin /usr/local/stunnel/etc/server.conf</div><div>user Â  Â  Â 1921 Â 1423 Â 0 10:37 ? Â  Â  Â  Â S Â  Â  Â 0:00 Â \_ /usr/local/stunnel/bin/stunnel.bin /usr/local/stunnel/etc/server.conf</div><div><br></div><div>selected pid 1423</div><div><br></div><div>Processes after:</div><div><br></div><div>UID Â  Â  Â  Â PID Â PPID Â C STIME TTY Â  Â  Â STAT Â  TIME CMD</div><div>user Â  Â  Â 1921 Â  Â  1 Â 0 10:37 ? Â  Â  Â  Â S Â  Â  Â 0:00 /usr/local/stunnel/bin/stunnel.bin /usr/local/stunnel/etc/server.conf</div></div><div><br></div><div>Here I sent the signal to the child. The parent shut down and the child completed normally.</div><div><br></div><div>Processes before:</div><div><br></div><div><div><div>UID Â  Â  Â  Â PID Â PPID Â C STIME TTY Â  Â  Â STAT Â  TIME CMD</div><div>user Â  Â  Â 1276 Â  Â  1 Â 0 10:31 ? Â  Â  Â  Â Ss Â  Â  0:00 /usr/local/stunnel/bin/stunnel.bin /usr/local/stunnel/etc/server.conf</div><div>user Â  Â  Â 1309 Â 1276 Â 0 10:31 ? Â  Â  Â  Â S Â  Â  Â 0:00 Â \_ /usr/local/stunnel/bin/stunnel.bin /usr/local/stunnel/etc/server.conf</div><div><br></div><div>selected pid 1309</div><div><br></div><div>Processes after:</div><div><br></div><div>UID Â  Â  Â  Â PID Â PPID Â C STIME TTY Â  Â  Â STAT Â  TIME CMD</div><div>user Â  Â  Â 1309 Â  Â  1 Â 0 10:31 ? Â  Â  Â  Â S Â  Â  Â 0:00 /usr/local/stunnel/bin/stunnel.bin /usr/local/stunnel/etc/server.conf</div></div><div><br></div><div>I know I should be trying threads. I will eventually. I can only switch once I validate it can sustain our level of traffic. Fork has done that flawlessly for many years now. <br></div><div><br></div><div>Best regards,</div><div><br></div><div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Philippe Anctil</div></div>
</div></div></div>