Reply to post: Arch Linux reasons for changing to systemd were not religious in nature.

Systemd supremo Lennart Poettering leaves Red Hat for Microsoft

Anonymous Coward
Anonymous Coward

Arch Linux reasons for changing to systemd were not religious in nature.

https://bbs.archlinux.org/viewtopic.php?pid=1149530#p1149530

Timing:

We don't have a date yet, but we have a list of blockers (we need the next releases of util-linux and sysvinit at least, and we need full coverage of systemd service files for all packages that have rc scripts). So I guess the best I can say is "when it is ready". There is also the added wish to do it "as soon as possible" as it will make the packaging of the next versions of certain packages (gnome, polkit at least, but probably many others that I'm not aware of) much easier.

Transition:

We have tried to make this smooth.

0) The best approach is to first bring your rc.conf up-to-date according to the recommendations in "man rc.conf". It should essentially only contain your DAEMONS array (and a few other things, depending on your setup, see manpage for details). This will work both with initscripts and systemd so it is safe to do ahead of time, and make sure everything works as it should.

1) Install systemd, but you do not need to remove initscripts. You can now chose between the two at runtime (by adding init=/bin/systemd to your kernel commandline). If you do this systemd will keep respecting rc.conf and use rc scripts if systemd unit files can not be found.

2) Then you can move your system (hopefully seamlessly) over to a native systemd configuration: do (0) if you did not already, then find the corresponding systemd service file for every daemon in your daemons array and enable it using "systemctl enable <daemon>.service". Once this is done rc.conf is not needed by systemd at all anymore. Go through rc.local and rc.local.shutdown and turn them into service files (or, if you intend to keep them as they are, copy /usr/lib/systemd/system/rc-local{,.shutdown}.service to /etc/systemd/system/).

3) Once the above works ok, and you are confident that you don't need to revert to initscripts, then you can install systemd-sysvcompat, which will conflict (and hence remove) sysvinit+initscripts (and pacsave rc.conf, rc.local and rc.local.shutdown). You can now also remove init=/bin/systemd from your kernel commandline as /sbin/init will now be a symlink to systemd.

Benefits:

I have spent too much time arguing against the perceived deficiencies of systemd (such as: "it is not written in bash", "it was started by Lennart Poettering", "I don't like the (optional) on-disk format of the journal", "it uses dbus", "systemd's PID1 does more and is bigger than sysvinit's PID1", "I think there might be this other project that possibly is doing something similar. I don't really know anything about it, but I'm pretty sure it is better than systemd" and I'm sure there are many more). I strongly believe that 1) all of these perceived deficiencies are not deficiencies, but are actually benefits 2) even if I'm wrong, these things are not hugely important. So, with that out of the way: let's ignore all of those old boring arguments and I'll outline a few things that I find awesome about systemd, and why I think we should all be very excited about soon being able to use it. In no particular order:

0) it is hotplug capable: systemd assumes that all resources may appear and dissapear at any time. If you plug in your external harddrive after systemd has booted, it will be fsck'ed and mounted correctly. This is unlike initscripts which relies on all disks being enumerated and ready when it starts fsck, and then it relies on fsck of all disks being finished before it starts mounting any of them. Hotplug is important, not only because it is convenient to be able to insert/remove hardware while the system is running, but also because that's how the linux kernel does boot: every device appears to be "hotplugged" as the kernel becomes aware of it, so with a very fast boot we can no longer assume that all devices are ready and waiting for us when we need them (even if they were plugged in when the computer started). In reality this is often not a problem, but if you ever had your rootfs on an external USB harddrive you might have experienced problems (and as things become faster and faster more problems like this will crop up).

1) we can know the state of the system: systemd keeps track of all daemons, and all processes that are started, and who owns what, and when something fails, etc. Also, using the (awesome) journal all syslog() entries and writes to stdout/stderr by all processes are captured by systemd. These are stored with enough meta-data so that you can very easily retrieve say "all entries from a certain service/binary/pid" or "all entries written by the kernel regarding a given device", etc. In addition to logging this information, and showing it to you, systemd will allow you to specify (easily) what to do in a wide range of possible error-scenarios: "a service shuts down normally/with an error/ on a signa" or "a service has not sent its watchdog signal in the designated time" or "a service has shutdown with an error 10 times in the last half hour". The recent addition of hardware watchdog support also allows you to say "restart the machine if systemd itself is not responding".

2) it is modular: all of what is now rc.sysinit is split out into many independent services, each of which is well documented and easy to understand. I.e., if you don't like how systemd e.g. does it's fstab handling, then you can write your own little helper (in bash if you wish) to replace the official one. Doing this in the old initscripts is much harder because 1) it is not so clear which parts of rc.sysinit are dependent on eachother 2) any changes you do you'll have to merge on every update.

3) it allows dbus/udev to go back to doing the task they are meant to do: both udev and dbus are currently (mis)-used to start daemons/long-running services on demand. In the case of dbus this is by design, but in the case of udev it is not. Either way, it is not what those daemons were built to do, so in keeping with the UNIX principle of one task per daemon, it is great that we can now let systemd (whose job it is to manage daemons) take this over. That is, udev and dbus can both signal systemd to start a certain daemon, and it will behave like if it was started in any other way (you have the logs, status etc). One problem that this solves is the inherent race-condition in some daemons (I think bluetoothd was guilty of this at some point) allowing both being started as soon as possible on boot (say by putting it in DAEMONS), and to be started on-demand by dbus. Systemd makes sure that both these things can happen, and if they do happen at the same time you will only end up with one instance of the daemon as expected.

... see the OP for the rest

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon