:: Re: [DNG] What is an init system?
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Steve Litt
Fecha:  
A: dng
Temas antiguos: Re: [DNG] Dng Digest, Vol 116, Issue 15
Temas nuevos: Re: [DNG] What is an init system? OT
Asunto: Re: [DNG] What is an init system?
R A Montante, Ph.D. via Dng said on Fri, 10 May 2024 07:28:53 -0400

>> From: Steve Litt<slitt@???>
>> To:dng@???
>> Subject: [DNG] What is an init system?
>> Message-ID:<20240510024818.32ee2c92@???>
>> Content-Type: text/plain; charset=US-ASCII
>>
>> 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.
>             ----&>< snip &>< --------
>> I'd love to explain how OpenRC, sysvinit and systemd work, but I
>> don't have a clue 🙂.
>>
>> SteveT
>>
>> Steve Litt
>>
>> Autumn 2023 featured book: Rapid Learning for the 21st Century
>> http://www.troubleshooters.com/rl21
>
>Steve, thanks for this great summary.  I've been a unix/linux end user
>for the last 40+ years, and just accepted the magic that was PID1.
>
>Are there any feature/behavior comparisons of sysvinit, runit, OpenRC?
> I'm not much interested in systemd as such.


Sysvinit's PID1 is pretty similar to that of runit and s6. Just fork
off what you want with a respawn command from /etc/inittab.

Sysvinit's process controller is, IMHO, inferior to runit and s6
because it requires daemons to background themselves, and its init
scripts are huuuuuuuge. Systemd advocates would also include as a
disadvantage that sysvinit's process controller can't fork processes in
parallel. I don't think that's a significant disadvantage unless a
daemon is incredibly slow in starting, in which case, shame on the
daemon or shame on the admin (if he botched reverse DNS, for instance).

Sysvinit's PID1 with runit or s6 as a process supervisor for *daemons*,
not config scripts etc, is a great setup. Just do the following in
/etc/inittab for a very simple no-runlevel runit:

respawn /usr/bin/runsvdir -P /var/service ........................

The series of dots should actually be at least 400 consecutive dots.

Every daemon run from runit or s6 should be disabled in sysvinit's init
scripts. I used to know how to disable init scripts in sysvinit, but
long ago forgot.

Unlike sysvinit, and like runit, s6 and systemd, OpenRC doesn't require
the daemons to background themselves. However, in the wild I've noticed
OpenRC scripts are very long.

Runit and s6 aren't guaranteed to work with daemons that background
themselves: A kludge is included to try to do this.

Runit is dead-bang simple. S6 trades a little simplicity for quite a
few more capabilities.

Systemd is a complexificated catastrophe.

HTH,

SteveT

Steve Litt

Autumn 2023 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21