:: Re: [DNG] init scripts
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Steve Litt
Fecha:  
A: dng
Asunto: Re: [DNG] init scripts
Antony Stone said on Tue, 1 Aug 2023 16:12:30 +0200

>On Tuesday 01 August 2023 at 16:00:54, o1bigtenor via Dng wrote:
>
>> Greetings
>>
>> I have been following the various threads re: init scripts with more
>> than some interest.


[snip

>> I'm not adverse to change - - - - just don't want to bork up working
>> systems - - - how could I change my init system and secondly which
>> direction do I head?
>
>I too am interested to know about the feasibility of changing the init
>system on a running machine (I assume it would need a reboot, of
>course, but not an entire re-installation).


My experience is that it's relatively easy to change init systems
*UNLESS* your current init system is systemd. I know I can do it by
installing runit or s6 direct from the upstream: I've done it. Matter
of fact, several times I've had two or more init systems at one time,
and just changed Grub to select which one. I don't know if runit, s6 or
Openrc installed by package manager would leave the existing sysvinit
intect.

[snip]

>
>I'm aware of the following init system options: systemd, sysvinit, s6,
>runit, openrc, upstart. I guess there are others.


As I remember, Karl Hammer uses Busybox Init. There's an unmaintained
by good one called Epoch. There are several minor league init systems.
And there are hybrid systems where PID1 is one init system, but uses
the process supervisor from another. In addition, there are hybrid init
system that use the PID1 from one init system and the process
supervisor from another. I think for awhile this is the ideal way to
init Devuan, but of course that's one person's opinion. I'll speak more
about this at the bottom of this email.

>
>Is it possible to take a system running any one of these and convert
>it to any other? That sounds like rather too much to expect...


Very possible.

>
>> (I know Steve likes one particular but others seem to lean in another
>> direction - - - -


This is true. I'm in love with runit and s6 (and daemontools before
them). You need to listen to others.

> how do I choose and why (the why is imo the most
>> important part of the answer).)


You've isolated the root of the decision: Priorities. I value
simplicity, and runit is so simple I could have programmed it myself,
if somebody had given me the specifications. s6 is a little less
simple but has every feature anyone could want. OpenRC is good enough
that Gentoo and Funtoo use it. Sysvinit is what everybody knows, and it
works. Systemd is great because you can tell the rest of the world "my
way or the highway."

I personally rule out sysvinit and OpenRC because of their complicated
init scripts. I just don't understand why it should take hundreds of
lines of shellscript to run a simple command. I mean yeah, those huge
script cover the corner case where you should kill one process before
killing the one you're trying to kill, but personally, I've not found
that a requirement.

So the choice is about priorities.

About the process of transitioning init systems...

Assuming you now have sysvinit, which on Devuan is a pretty good
assumption, you can continue using sysvinit's very nice PID1, and
slowly transition process supervision from sysvinit to runit (or s6),
process by process. In this way you learn more about runit or s6, and
slowly move the work from sysvinit to s6. When all the processes have
been transferred, you can switch PID1s if you want. Or just keep using
your hybrid as long as Devuan keeps offering sysvinit. My only
objections to sysvinit are about its process management, not its PID1
duties.

SteveT

Steve Litt
Autumn 2022 featured book: Thriving in Tough Times
http://www.troubleshooters.com/bookstore/thrive.htm