Miscellaneous ephemera…

The Leap to systemd

I posted a couple of weeks ago about the impact of some of the current changes to Arch Linux. There seems to be quite a bit of it about, because in conjunction with the move from /lib to /usr/lib—and motivated by the same overarching shifts in the other distributions—the other major change making its way through the Arch community is the move to systemd. This change, however, has been more controversial because it marks a shift away from Arch’s central configuration file, /etc/rc.conf; a move that has disconcerted a number of people.

I’m not going to get into whether or not this move is consistent with The Arch Way, because that has been thrashed over extensively on the mailing lists, but also—and more importantly—because Arch is a rolling release, which means change is inevitable. What is more, after watching all the back and forth on the ML and on the boards, I am convinced that the developer overseeing this shift both knows what he is doing and is acting in the best interests of Arch.

This view has been validated by my experience of shifting to systemd on my machines.

When the new initscripts package was pushed to [testing] in the middle of last month, I stripped out all of the redundant options in /etc/rc.conf and took the ten minutes or so to read about and then create the new files. I then spent some time reading up on systemd, principally Lennart Poettering’s series of posts, the Arch wiki entry and the many and various manual pages.

Over the last couple of days, I have migrated all of my machines over to systemd. I found it to be a very straightforward process. I went for a pure systemd approach, for reasons I will return to. Essentially, this is how I tackled it.

First, for each machine, I established what daemons were running. I did this by using this shell script and cross checking entries in my /etc/rc.conf. Then it was just a matter of installing systemd:1

sudo pacman -S systemd systemd-sysvcompat systemd-arch-units

The only outstanding file to be created was /etc/timezone, the others—all documented in man rc.conf—I had created earlier in the month. Then, with the list of the services I would need running on each box, I enabled them. I think it is fair to say that the only thing that is clunky about systemd is the command syntax for managing units. Repeatedly typing systemctl enable foo.service is as tedious as it is error prone, so I hacked up a wrapper script:

sysd enable acpid
sysd enable lvm

I also activated some additional gettys, as I like to log into a tmux session in TTY2 when I don’t need or want to start X:

ln -sf /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty2.service

And I misguidedly wrote a couple of custom service files that turned out to be completely unnecessary; and then I was done.

On all three boxes I rebooted and that was it. The only issue I experienced was the final shutdown after removing initscripts and before booting up with systemd. After issuing shutdown -r now the process hung with a message about a missing inittab file. In retrospect, I should have added init=/bin/systemd to my kernel parameters and not unistalled instiscripts until I had booted with systemd. This has now been added to the systemd wiki page.

Overall, though: no real drama, just a blur of text2 and then the login prompt. While I haven’t seen a dramatic decrease in boot time, booting does feel a bit snappier and two of my three machines shutdown markedly more quickly. Consider me sold.

That brings me back to the decision to opt for a pure systemd approach, rather than hanging on to a completely eviscerated /etc/rc.conf. The Arch community has been told that the intention is to support the rc.conf format forever; I can’t help but think this is a mistake. In the same way that partial upgrades are unsupported, I think that systemd is Arch’s inevitable future and the community should be encouraged to accept that, Syu and move on…

Having said that, I appreciate the consideration shown by the developers in wanting to assure people that their choice would continue to be catered for; and perhaps, over time, people still using initscripts will be regarded with the same sense of wry amusement as those who still show up from time to time with hal in their DAEMONS line.

Update 4/8/12

Tom Gunderson, the developer who looks after this part of Arch, has clarified the comment about the long term support for initscripts. As comments are hosted on a third-party paltform, I thought that it should be included in the body of the post.

Just a clarification: regarding the (probably very unwise) promise of "supporting rc.conf forever", the intended meaning was that initscripts will support the syntax, not that initscripts themselves will always stay around (nor that systemd will gain support for the syntax in case initscripts is dropped).

At the moment systemd does support rc.conf (when installed in conjunction with initscripts), but this is meant as a transitional measure only, and will likely go away eventually (though probably not soon).

Tom Gunderson


  1. Note this approach will remove sysvinit and initscripts and mv /etc/rc.conf{,.pacsave}.
  2. Make sure you remove quiet from your kernel parameters for your first systemd boot so you can see that everything starts correctly…

Creative commons image on Flickr by Tricky