Martin "eto" Misuth:
I think Mr Jonathan de Boyne Pollard might be cooking, or even already has, something similar in nosh.

Long since.  (-:  It was in version 1.0 .

Martin "eto" Misuth:
at some point I was interested in digging out whether systemd had "subreapers" at it's disposal, and why it didn't use them

It has. The systemd people were responsible for getting this mechanism into Linux in the first place.

* http://unix.stackexchange.com/a/177361/5132

Martin "eto" Misuth:
- observing behaviour of reparenting under init for thousands of times in htop

Now observe it under not init and not htop.  (-:

Here's the nosh service manager's subreaper mechanism in action. Process 31427 is a per-user service manager, which is a subreaper. Process 9408 is GNOME Terminal and process 9412 is a Z Shell running connected to that terminal. In the shell, I ran (sleep 6000&) which resulted in an orphaned sleep process, process 9451. As you can see, that process has been reparented to the nearest subreaper.

per-user-manage(31423)-+-cyclog(31426)
                       `-service-manager(31427)-+-3(6088)
                                                |-4(31592)-+-{decoder}(31598)
                                                |          |-{io}(31596)
                                                |          |-{output:default 
}(31599)
                                                |          `-{player}(31597)
                                                
|-at-spi-bus-laun(9276)-+-dbus-daemon(9290)
                                                |                       
|-{dconf worker}(9277)
                                                |                       
|-{gdbus}(9279)
                                                |                       
`-{gmain}(9291)
                                                
|-at-spi2-registr(9293)---{gdbus}(9296)
                                                |-cyclog(6070)
                                                |-cyclog(18028)
                                                |-cyclog(20138)
                                                |-cyclog(30089)
                                                |-emacs(6094)---{gmain}(6095)
                                                
|-gnome-terminal-(9408)-+-gnome-pty-helpe(9411)
                                                |                       
|-zsh(9412)---pstree(9482)
                                                |                       
|-{dconf worker}(9409)
                                                |                       
|-{gdbus}(9410)
                                                |                       
`-{gmain}(9413)
                                                |-gvfsd(9305)---{gdbus}(9306)
                                                
|-pulseaudio(3625)---{null-sink}(3626)
                                                `-sleep(9451)


Reply via email to