Hey Ludo, I've re-written my patch, and it's attached in two commits. The first one adds the necessary calls to prctl, and the second adds the fallback to polling. On Fri, Mar 02 2018, Ludovic Courtès wrote: > The ‘prctl’ procedure itself should simply throw to > 'system-error on GNU/Hurd. But then, in (shepherd), we could add > the polling thing when (not (string-contains %host-type > "linux")). > > WDYT? I don't like the idea of doing this based on the host type. In my patch I've done it based on whether the prctl call succeeded. If the prctl call throws a system-error then we poll, otherwise we rely on SIGCHLD. I don't have a system set up with another kernel, though, so I don't know how I can easily test whether the fallback logic is working properly. When I replaced the prctl call with (throw 'system-error) it seemed to work. The fallback code still fails in the guix build environment (as my previous patch did), but when it's using prctl it works properly. This means that a build on Linux pre-3.4, or on Hurd, will fail, which probably isn't acceptable given that shepherd is a hard dependency for starting a GuixSD system. As far as I can tell the test fails because the processes stick around as zombies, so I assume that pid 1 in the build container isn't properly reaping zombie processes. Do you have any ideas how I can force it to do so? > We want to set the “reaper” of child processes to Shepherd > itself, so we must do that in child processes. The shepherd > process cannot be its own reaper I suppose. Reading the manpage, and then running some code, I think you're wrong about this. Using prctl with PR_SET_CHILD_SUBREAPER marks the calling process as a child subreaper. That means that any processes that are orphaned below the current process get reparented under the current process (or a closer child subreaper, if there's one further down). If there are no processes marked as child subreapers, then the orphaned process is reparented under pid 1. We should only need to call prctl in two places: when shepherd initially starts, or when we fork for daemonize. Carlo