:: Re: [DNG] Various init systems and …
Top Page
Delete this message
Reply to this message
Author: Martin Steigerwald
Date:  
To: dng
Subject: Re: [DNG] Various init systems and process supervision: openrc, runit, ...
Greetings.

Steve Litt - 14.12.25, 12:13:45 CET:
> Hendrik Boom said on Sat, 13 Dec 2025 11:58:59 -0500
>
> >What are the reasons for choosig operc vs runit?
>
> I'm biased, so please take that into account. I'm so in love with runit
> my wife is jealous.
>
> AFAIK, openrc uses ginormous init scripts similar to those of sysvinit.
> Runit's run scripts are usually less than 10 lines: Often less than 5.


Haha, I believed that knowledge to be outdated, but for example chrony
startup in Alpine Linux is 39 lines with OpenRC, granted with 5 lines of
comments:

https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/chrony/
chronyd.initd

However there can be shorter ones like the one for dhcpcd – and it seems
to be quite declarative:

https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/dhcpcd/
dhcpcd.initd

Also it appears to me from reading into those that OpenRC can handle
foreground processes meanwhile.


Runit Chrony startup is an art of beauty instead:

% /etc/sv/chrony/run 
#!/usr/bin/env /lib/runit/invoke-run
#Copyright: 2005-2008 Gerrit Pape <[…]>
#           2022 Lorenzo Puliti <[…]>
#License: BSD-3-Clause


exec 2>&1

exec /usr/sbin/chronyd -d $DAEMON_OPTS


And its finish script is just 4 lines.


Regarding Sysvinit in Debian there is the init-d-script framework that can
make an init script basically a four line variable declarative thing
except for declaratory comments and a FreeBSD boilerplate for sourcing
init-d-script. Overrides for default actions are still possible.

See for example what I did with /etc/init.d/fio in my fio package.


However I am not even sure whether this comparison work is really getting
to the core of the differences between OpenRC and Runit. As to my
knowledge all the init systems I know of – Sysvinit, OpenRC, Runit and
Systemd¹ – all of them need shell boilerplate code to some extent. Yes,
those short run scripts of Runit are an art of beauty. But there are also
the longer stage scripts in /etc/runit/{1,2,3}.

Actually through working on my Incus runit support merge requests,
receiving all the brilliant comments from Lorenzo, Andrew and Mathias I
truly got to understand more of some of the beautiful concept of
simplicity in Runit.

https://salsa.debian.org/go-team/packages/incus/-/merge_requests/1


[1] Yeah, it degenerated from an self-proclaimed init system to a
framework of system building blocks. Self-proclaimed means that Lennart
initially wrote it would be an init system replacement and later only
spoke about system building blocks while pretending he never said or wrote
the first. That is at least how it happened according to my memory but I
spare myself the time to dig that out. It should be verify-able through
his blog posts.

Best,
--
Martin