Booting Up systemd at Facebook with Lennart Poettering
August 11, 2015As I walk into the Facebook office on the 8th floor at 770 Broadway, I am greeted by a robot asking for my email, which I have to trade with Facebook for my entrance to the event. Sure, why not. It’s worth it.
Lennart Poettering is leading a discussion on systemd, and I am psyched.
Of course, Poettering is the creator of the controversial open-sourced systemd protocol that is shaking up Linux-based operating systems. More details are on his website
systemd 101
systemd is the basic building block of most unix systems and the main contender against “Upstart” and “sysvinit”. Systemd was inspired by Launchd’s dependency-based system and its bootup socket service, to create the ability to run system daemons without having to manually execute these daemons. SMF’s (Solari’s init.d system) XML is a strong design based on declarations.
Some Love systemd, Some Don’t
It’s a suite of system management daemons, libraries and utilities designed as a central management and configuration platform, aimed at replacing the init system on Linux Systems. Some love it, some don’t, but it is becoming widely adopted by most of the linux distros.
systemd is modular at the compilation phase. It’s not necessarily what people are looking for when talking about modules, but it gives you the ability to choose certain resources to use at startup. For example, it gives you the ability to choose your log reporting system. It’s always good to have options!
Development started in 2009, with the idea of creating a new boot up system. Lennart thought the init system was not how modern systems should work and set out to replace the system V init daemon.
Poettering himself describes systemd development as “never finished, never complete, but tracking progress of technology”.
It made its debut on April 2010 and was implemented a year later as the default boot up system by Fedora’s 15/May 1011 release.
If you are in the systemd world, there will be a conference this year in Berlin.
systemd vs. Upstart
“Upstart” was a great piece of code but it was not part of the feature. It was strictly event-based. Defining events and “gluing” them together was not an ideal structure. Dependencies were what modern systems were looking for. Upstart effectively maximized the bootup, while systemd did the opposite, minimizing the requirements for bootup. It was good while it lasted, Upstart…
Taken by some people as the answer to the question that nobody asked, systemd took over many, if not all popular Unix distros. It sparked heated discussions and long debates whether to move from the old script-by-script startup to a sleek set of modern binaries.
Many administrators said that the previous system was not broken, so why replace it?
The Unix Philosophy
When Lennart presented the “Unix philosophy” as summed up by Mike Gancarz, author of “Linux and the Unix Philosophy” people got a bit noisy. The Unix philosophy is quite subjective…
Mike Gancarz’ 9 Unix principles are:
- Small is beautiful.
- Make each program do one thing well.
- Build a prototype as soon as possible.
- Choose portability over efficiency.
- Store data in flat text files.
- Use software leverage to your advantage.
- Use shell scripts to increase leverage and portability.
- Avoid captive user interfaces.
- Make every program a filter.
Most certainly, all modern APIs and Linux applications are built under these 9 principles. But systemd trumps all of them! This behavior has been around the open source community for some time. Core components get “upgraded” or “renovated” by poorly built, designed or just inferior predecessors. For example, the UNIX systems idea of “everything is a file” finds reflection in that in systemd all services are exposed at runtime in a kernel file system, the cgroupfs.
It has always been hard (impossible?) to keep everyone happy…
Poettering’s Discussion on Containers
In his discussion, Poettering focused on containers and Systemd inside of those containers. He pointed out that the system by default should know what the containers are and should be able to orchestrate them.
These are some programs that come with the systemd stack.
You can see in the diagram below “systemctl” “journalctl” and “notify” are all utilities that come with systemd.
systemd-nspawn:
Spawns is a namespace container for debugging, testing and building. RKT is built on it. Think of it this way: QEMU does for the system what Systemd-nspawn does with containers. Simple, yet powerful.
systemd-machined:
A place to register containers (and VMs)
systemctl
List-container
systemd-import:
Allows you to add more containers (and VMs) to your local system from public repositories.
Machinectl:
May be used to introspect and control the state of virtual machines and container registration manager.
systemd’s focus is about making the best of Linux and using its features to an advantage. systemd is not intended to be portable, which opens up numerous new possibilities.
Q&A with Poettering
Q: Why did you push through systemd?
A: People involved were weird in a way. Me and Kay (Sievers) didn’t feel bad in working against the tide. We didn’t care about change. We wanted to make this the future.
Q: Main criticism: monolithic system.
A: Other people think that they should be able to use the network daemon without touching the system, in systemd, it talks directly to the system and its bootup sequence.
Q: “How can you handle all the extreme trolling and bad vibes coming from old unix users who invested a life in learning the init system?”
A: “Beer helps. The Debian community adopting systemd —a. very. fun. fact—didn’t want to use it because it didn’t run on BSD kernels. The unix philosophy is to use software tools instead of software applications. Meaning lots of little programs work in conjunction with each other in order to solve one big problem.
systemd on the other hand, is one piece of software that does what was traditionally the cumulative job of a bunch of software tools.”
“I personally feel that the unix philosophy was needed back when the industry was young and it was difficult even for large corporations to be able to develop big pieces of software. Things have changed. Programmers and their tools are much more advanced now. It’s time to let go of the unix philosophy.” – Poettering
I’m getting hungry, Facebook, where can I trade emails for snacks?