[arch-general] [Bulk] Re: RFC: OpenRC as init system for Arch

C Anthony Risinger anthony at xtfx.me
Sat Apr 28 17:05:54 EDT 2012


On Fri, Apr 27, 2012 at 12:08 PM, Jan Steffens <jan.steffens at gmail.com> wrote:
> On Fri, Apr 27, 2012 at 10:53 AM, Kevin Chadwick <ma1l1ists at yahoo.co.uk> wrote:
>> We are going to sacrifice, simplicity, amount of code to look for bugs
>> and most importantly, ease of troubleshooting. One of the beauties of
>> Unix is the error information. Aren't they all going to be mixed
>> together on systemd. Imagine if all drivers loaded at once. Ughh Would
>> many resort to Windows style trial and error more often.
>
> One of the features of systemd is the large amount of metadata the
> journal colllects. This allows filtering on the message source, for
> example. Right now that's just the process (and service) that
> generated them, but with the coming udev integration and kernel
> logging improvements, you will also be able to view kernel messages by
> device or module.

yes this is nice :-)

by far and large, systemd is the init system as i imagined it *should*
be, when i first started using linux ... i can't count the number of
times i thought "/sbin/init doesn't do a damn thing, and is utterly
useless"

"bloat" is not measured by LOC, but rather by degrees of uselessness.

i have converted several desktops -- and servers -- to use systemd
*exclusively*.  by this i mean i subsequently "pacman -R initscripts
sysvinit".  haven't looked back, and not a single issue that wasn't my
own doing.

after a small amount of learning you can bang out unit files with EASE
... just the other day, i wrote a fwknop.service in probably 5 minutes
or less.  now i get to do this ...

-----------------------------------
# systemctl status fwknopd.service
fwknopd.service - firewall knock operator daemon
          Loaded: loaded (/etc/systemd/system/fwknopd.service; enabled)
          Active: active (running) since Sat, 28 Apr 2012 16:06:08
-0400; 37min ago
        Main PID: 18452 (fwknopd)
          CGroup: name=systemd:/system/fwknopd.service
                  └ 18452 /usr/sbin/fwknopd --config-file
/etc/fwknop/fwknopd.conf.local --foreground

Apr 28 16:06:08 some-server.xtfx.net fwknopd[18452]: Starting fwknopd
Apr 28 16:06:08 some-server.xtfx.net fwknopd[18452]: Added jump rule
from chain: INPUT to chain: FWKNOP_INPUT
Apr 28 16:06:09 some-server.xtfx.net fwknopd[18452]: PCAP filter is:
udp port 62201
Apr 28 16:06:09 some-server.xtfx.net fwknopd[18452]: Starting fwknopd
main event loop.
Apr 28 16:06:19 some-server.xtfx.net fwknopd[18452]: (stanza #1) SPA
Packet from IP: 1.2.3.4 received with access source match
Apr 28 16:06:19 some-server.xtfx.net fwknopd[18452]: Added Rule to
FWKNOP_INPUT for 1.2.3.4, tcp/22 expires at 1335643609
Apr 28 16:06:49 some-server.xtfx.net fwknopd[18452]: Removed rule 1
from FWKNOP_INPUT with expire time of 1335643609.
-----------------------------------

... (root needed to see journal) see all that extra info after the
status?  that's the systemd journal capturing the stdout of the
foreground process it monitors.  the syslog-like timestamps are added
by systemd.

i have custom units managing daemons like this, timers syncing
archlinux mirrors, units modifying /sys/ tunables (there is no
`sysctl` for sysfs!), some that run/reboot XBMC on my HTPC ...

... and on servers especially, i even have units bound to ethernet
devices, automatically managing the interface, and/or starting dhcp!

-----------------------------------
# systemctl status net-dyn-phys at eth0.service
Password:
net-dyn-phys at eth0.service - dynamic inet interface [phys:eth0]
          Loaded: loaded
(/etc/systemd/system/sys-subsystem-net-devices-eth0.device.wants/../net-dyn-phys at .service;
enabled)
          Active: active (running) since Thu, 26 Apr 2012 23:38:40
-0400; 1 day and 17h ago
        Main PID: 175 (dhcpcd)
          CGroup: name=systemd:/system/net-dyn-phys at .service/eth0
                  └ 175 /usr/sbin/dhcpcd --config /etc/dhcpcd.conf.local eth0

Apr 26 23:38:45 some-server.xtfx.net dhcpcd[175]: eth0: leased 5.6.7.8
for 86400 seconds
Apr 27 11:37:57 some-server.xtfx.net dhcpcd[175]: eth0: renewing lease
of 5.6.7.8
Apr 27 11:37:57 some-server.xtfx.net dhcpcd[175]: eth0: acknowledged
5.6.7.8 from 74.207.239.122
Apr 27 11:37:57 some-server.xtfx.net dhcpcd[175]: eth0: leased 5.6.7.8
for 86400 seconds
-----------------------------------

... and i plan to make this even more automatic/intelligent in the
future.  i also use a handful of other units developed by Exherbo
(git-daemon) that required no changes whatsoever to work for
Archlinux.  how's that for cross-platform?

in summary: systemd is fanta-bulous ... and IMO, anything less is just
as useless as that which preceded it.  i have no reservations
for-or-against OpenRC, but systemd is the new precedent for
how-to-build-an-init-system-for-modern-systems.

-- 

C Anthony


More information about the arch-general mailing list