ensure that child tasks die when the parent dies
authorAndrew Tridgell <tridge@samba.org>
Fri, 7 Aug 2009 07:21:54 +0000 (17:21 +1000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 7 Aug 2009 07:24:48 +0000 (17:24 +1000)
commitc271dc998ba25101a46e7d4b2187567a07588ca2
tree20270a68759dc336855a60ff704d201f91acc936
parentcfc0cabb27c7323930b96dd93befa955bacd6cde
ensure that child tasks die when the parent dies

Previously we relied on process groups and SIGTERM to ensure that
child tasks died in the standard process model when the parent task
died. This doesn't work when the server is run in interactive mode, as
in that case we don't call become_daemon() and don't get a separate
process group.

The fix is to have a pipe held open by the parent server process, and
inherited by child tasks. If the parent exits then the write side of
the pipe is implicitly closed, which causes an event in the child
tasks that causes them to exit
source4/smbd/process_standard.c