Process hierarchy on a DC?
slow at samba.org
Sat Apr 29 10:30:57 UTC 2017
On Sat, Apr 29, 2017 at 05:18:19AM -0400, Simo Sorce via samba-technical wrote:
> Sorry for the dumb question, but why are you doing double forks and escaping
> the original process group,
fwiw, this is actually not caused by my code, running in a different process
group (and session) is just the expected result given the arguemts source4
passes to samba_runcmd_send() to start smbd and winbindd. It doesn't pass
--no-process-group so smbd and winbindd put themselves in a new process group by
calling become_daeomon() with no_process_group=false.
> ... and then try to undo all this stuff by sending
> around new process groups to kill ?
The idea is to avoid dealing with SIGCHLD and waitpid in the caller.
> Why not just do a simple straight fork and retain the process group and
> hierarchy ?
Because it's requires coordination with other subsystems that use fork. Eg in
source3 we use CatchChild() to install a SIGCHLD handler what reaps alld
child. This interferes with the current implementation of samba_runcmd_send().
More information about the samba-technical