:: Re: [DNG] Mini init script written …
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Steve Litt
Fecha:  
A: dng
Asunto: Re: [DNG] Mini init script written in Perl boots.
On Fri, 17 Jun 2016 16:55:40 +0200
Irrwahn <irrwahn@???> wrote:


> A minimal PID1 (written in whatever language) is not an init
> system.


Everyone should note the preceding sentence. A lot of people use PID1
and "init" interchangeably, and that's wrong and leads to problems. As
a matter of fact, it seems like everybody is making up their own
definitions of "init", including a lot who use the word as just a
reference to sysvinit.

My personal definition of "init" or "an init system" is that it has a
PID1 that reaps zombies and looks for and handles the reboot signal,
and it has a section, inside or outside of PID1, that manages or
supervises processes.

My personal preference is an init with PID1 doing nothing but spawning
an rc script and then spinning forever, looking for signals. In a real
system, that rc script must run a process manager or supervisor after
doing some early boot work.

> In your example you hid the insteresting stuff behind
> some obscure script misleadingly called "osloader.sh". What
> was your point again?


It's a proof of concept. From there, he puts all the early boot stuff
into osloader.sh, and if I were him, the last line of osloader.sh would
invoke something like daemontools-encore's svscanboot, or runit's
runsvdir, or s6's s6-svscanboot, or sysvinit's /etc/init.d/rc 3 or
OpenRC's startup script if you drive on that side of the road.

It's the knowledge equivalent of pulling yourself up by your
bootstraps, and when he's done documenting it anybody can follow in his
footsteps. And those who *do* follow in his footsteps will find it easy
to install something like runit or s6 to initialize their machine.

SteveT

Steve Litt
June 2016 featured book: Troubleshooting: Why Bother?
http://www.troubleshooters.com/twb