:: Re: [DNG] Mini init script written …
Góra strony
Delete this message
Reply to this message
Autor: Didier Kryn
Data:  
Dla: dng
Temat: Re: [DNG] Mini init script written in Perl boots.
Le 17/06/2016 12:22, Irrwahn a écrit :
> On Fri, 17 Jun 2016 12:04:03 +0200, Didier Kryn wrote:
>> >Le 17/06/2016 07:24, Steve Litt a écrit :
>>> >>Edward's pid1 shellscript has exactly one child, /sbin/osloader.sh.
>>> >>That child can fork off a whole lot more processes. So theoretically,
>>> >>with Edward's PID1 instead of sysvinit, only one process would have a
>>> >>PPID of 1, that being /sbin/osloader.sh.
>> >      Yep. All the daemons will have ppid==2 . I love that:-)

>
> That would be bad, as PID1 is the one reaping dead child
> processes. Thus daemons should have it as their parent, and
> doubly-forked processes already do, just as any orphaned
> process will eventually end up having a PPID of 1.
>
> Unless PID2 is a dedicated process supervisor that monitors
> its children and does the bookkeeping, but I would not expect
> that from the shell script in the example above.


     Right. Either pid2 is a supervisor and then it reaps and relaunches 
it's own children, or it is not and it dies, in which case the orphans 
get adopted by pid1. What would be evil would be a pid2 which wouldn't 
supervise its children and go do something else forever, but, definitely 
that would be for no other reason than fucking the (operating) system.


     This way you can see if daemons are supervised (ppid==2) or not 
(ppid==1) :-)


     Didier