:: Re: [DNG] What is an init system?
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Didier Kryn
Ημερομηνία:  
Προς: dng
Αντικείμενο: Re: [DNG] What is an init system?
Le 10/05/2024 à 08:48, Steve Litt a écrit :
> Hi all,
>
> Just so we're on the same page, an init system is a PID1 plus code
> (could be a shellscript) to do all config, mounting, and system setup,
> as well as starting up all the daemons. To a greater or lesser or
> possibly zero extent, this code, which might be a shellscript or might
> not, also controls the daemons on an ongoing basis running of daemons
> and in many cases gives the admin an easy way to start, stop and
> restart daemons.
>
> Under the preceding definition, you could compile Rich Felker's 16 line
> PID1 program, which reaps zombies and forks off a shellscript called rc
> to do the rest of the boot.
>
> In real life PID1 needs to respond to a few more signals. Suckless
> Init, as displayed at
> https://git.suckless.org/sinit/file/sinit.c.html, does this. On ALRM and
> CHLD it reaps a zombie. On USR1 it powers down, and on INT it reboots.
> What it does to power up or power down is defined in the .h file, which
> can be as simple as running a shellscript.
>
> Runit is built pretty much this same way, but separates mounting and
> configuration (stage 1) from daemon supervision (stage 2), and moves
> some other work, especially backgrounding the daemons, to itself, so
> neither the run script authors nor the daemon authors need to worry
> about backgrounding anything.
>
> S6 is pretty much the same as runit except that s6 includes in PID1
> code to restart the rest of the boot. The last few years other separate
> programs have been added to s6 to facilitate specific ordering of
> daemon startup at runtime, which is absent from s6. S6 also now has
> code to receive from the daemon the news that the daemon is now running
> and ready. S6's readiness notification system is simply an open fifo or
> something like that and is MUCH simpler than systemd's crazy readiness
> notification system. S6 has been built up in the past few years to
> include all *reasonable and necessary* features of systemd, done in a
> much simpler and more modular way.
>
> I'd love to explain how OpenRC, sysvinit and systemd work, but I don't
> have a clue :-).
>
> SteveT
>
> Steve Litt


    I am following the skarnet mailing list with some fascination for
its inovations. S6 comes in this context of a very new and clever
ecosystem with things like /execline/. But this context is not (yet ?)
familiar to most Linux/Unix admins. I bet S6 would be my startup system
of choice for servers. But I don't run servers anymore, and, as an end
users of Linux, I do not need all this complexity.

    HTTP, SSH or CUPS servers practically never fail. In case this
would happen on a personnal laptop or desktop, reboot is so quick (25s
on my 10y-old laptop) that the admin does not need to learn all this
burden of startup config. I bet for these, as from reading Steve's
expert advices, that runit is probably the simplest.

   I think the major choice, when installing the OS, is between the
complexity of a server - possibly administered remotely - and the
simplicity of a personnal computer.

--     Didier