[ale] New user introduction

Steve Litt slitt at troubleshooters.com
Mon Aug 20 20:05:40 EDT 2018


On Mon, 20 Aug 2018 11:55:37 -0400
Simba via Ale <ale at ale.org> wrote:

> I like systemd. I hated writing init scripts. I know it's not as
> simple as that, but so far I haven't been burned.

There are other alternatives besides systemd and sysvinit (the one
with /etc/inittab and huge init scripts). These alternatives are IMHO
vastly superior to systemd and sysvinit. Check out runit and s6 (plus
s6-rc) for starters:

http://smarden.org/runit/

https://skarnet.org/software/s6/

I use runit, including to manage home-grown daemons, and it works
consistently and beautifully. Here's my runit run script for the
ntpd time daemon:

===========================
#!/bin/sh
[ -r conf ] && . ./conf
exec ntpd -d ${OPTS:=-s} 2>&1
===========================

In the preceding, on my machine, there's no conf file, so the middle
line is scaffolding that in my case could be deleted.

And here's my run script for a logging facility for ntpd:

===========================
#!/bin/sh
exec logger -t openntpd -p daemon.notice
===========================

In the preceding, -t just tags every log line with "openntpd", and the
-p indicates a port number that I guess has the alias "daemon.notice".

Compare these to the suggested init scripts for ntpd, and you get the
idea how much simpler runit is.

I performed a wc command on the entirety of runit source code tree,
like this:

find runit-2.1.2 -exec cat {} + | wc -l

The preceding counts documentation lines, lines out of binary files,
distro specific stuff, and everything else, most of which doesn't end
up in your executable. And yet the preceding command resolves to 33162,
approximately 34 times less than the 1 million plus lines of code in
systemd.
(https://www.phoronix.com/scan.php?px=systemd-2017-Git-Activity&page=news_item)

Moving from sysvinit to systemd because you don't like long init
scripts is like moving from Atlanta to Antarctica because you don't
like  extreme automobile traffic. In both cases, there are less radical
ways to achieve your goal.

SteveT

Steve Litt 
September 2018 featured book: Quit Joblessness: Start Your Own Business
http://www.troubleshooters.com/startbiz


More information about the Ale mailing list