September 5th, 2024

Porting systemd to musl Libc-powered Linux

An initial port of systemd to musl libc-powered Linux has been completed, resolving multiple test failures. The system boots faster than OpenRC but needs refinement before a public beta release.

Read original articleLink Icon
Porting systemd to musl Libc-powered Linux

An initial port of systemd to musl libc-powered Linux has been completed, focusing on creating a patch series that aligns with the latest systemd and musl releases. The project, driven by a long-standing interest in providing multiple service managers, was supported by Wilcox Technologies Inc. (WTI) on a contract basis. The porting process began with systemd version 256.5, addressing build errors and running a test suite that initially had 27 failures, most of which were resolved through simple fixes. Notably, a challenge arose with the time-util test due to musl's lack of support for the %z format specifier, which was overcome by implementing a translation. The final tests revealed a PPC64-specific bug, which was also resolved. The successful boot of an Adélie Linux system using systemd marked a significant milestone. Although the system demonstrated faster boot times compared to OpenRC, it still requires further refinement, particularly regarding service unit files and potential PolicyKit issues. The project aims to enhance user choice in Linux systems, with plans for a public beta release pending further testing and collaboration with other projects.

- An initial port of systemd to musl libc-powered Linux has been completed.

- The project was supported by Wilcox Technologies Inc. and aims to enhance user choice.

- The porting process involved resolving multiple test failures, including a PPC64-specific bug.

- The system boots faster than OpenRC but requires further refinement before public release.

- Collaboration with other projects is ongoing to ensure quality and functionality.

Related

Systemd Looks to Replace sudo with run0

Systemd Looks to Replace sudo with run0

Systemd introduces "run0" to replace sudo in Linux. It offers secure user elevation without SUID, using a service manager for command execution. Creator Poettering aims for enhanced security and usability. Systemd 256 with run0 is on GitHub for testing.

Lennart Poettering: Fitting Everything Together

Lennart Poettering: Fitting Everything Together

The blog post explores integrating systemd components for Linux OS development, emphasizing hermetic /usr/ design, image-based OS with security features, self-updating systems, and community-driven desktop OS with advanced security measures.

PostmarketOS updates: new homepage, pmbootstrap v3, sensors, libcamera

PostmarketOS updates: new homepage, pmbootstrap v3, sensors, libcamera

postmarketOS revealed a new homepage design by Dika, Markus, and Oliver, with improved navigation and team page. Updates include pmbootstrap v3.0.0_alpha release, new device ports, sensor support, and various enhancements. Future plans involve systemd work and contributor compensation.

Systemd Talks Up Automatic Boot Assessment in Light of the CrowdStrike Outage

Systemd Talks Up Automatic Boot Assessment in Light of the CrowdStrike Outage

In response to the CrowdStrike-Microsoft outage, systemd's lead developer, Lennart Poettering, promotes systemd's Automatic Boot Assessment for Linux systems. Despite its support, major distributions have not adopted it. Poettering stresses the importance of implementing such features for system security and recovery.

BusyBox: Life Without Systemd (2018)

BusyBox: Life Without Systemd (2018)

The article details configuring a Fedora machine to use BusyBox's runit instead of systemd, including service management, network setup, and improvements for user-friendly logging and service dependencies.

Link Icon 14 comments
By @dmwilcox - 8 months
it's funny that many people mention boot time as a metric when for most servers, VMs and laptops the devices are either always on or sleeping. startup times do nothing in those cases.

personally I use a custom alpine live-usb that is immutable and I fully shutdown and start-up all the time. openrc doesn't give me any grief, the bulk of my startup time is copying my 500mb rootfs into a tmpfs

systemd for me is solidly "at work" software, and not stuff I'm a big fan of either (journald, networkd and the silly dns resolver all have serious issues). so please, keep away from my alpine or I'll have to fork -again- :)

By @bhaney - 8 months
> boots in 1/3rd the time of OpenRC on the same system

Wow, that's a suspiciously impressive difference. I was under the impression that OpenRC and systemd support similar parallel service startup features and usually boot systems in approximately the same amount of time, with maybe a slight edge to systemd. 3x speed makes me wonder if there's something else going on, like the current early systemd port having some bugs that cause it to incorrectly skip some important work.

Either way, super cool. What's the likelihood that this ends up getting upstreamed?

By @M95D - 8 months
I recently removed most of openrc and started using only a custom inittab. The boot time was shortened by at least 10s and I have more control over what starts and when. I'm going to absolutely hate the day when firefox will depend on systemd (or systemd replaces firefox, whatever happens first).
By @RVuRnvbM2e - 8 months
If alpine gets systemd it would be an amazing bare metal server or workstation distro. Openrc lacks so many features by comparison.
By @synergy20 - 8 months
Popular linux based embedded project called yocto will benefit a lot when systemd and musl works well together, using systemd-glibc it brings a few MegaBytes to the build, which is sometimes too large. I'm sure musl can bring down the size a lot.
By @e12e - 8 months
> And that is how I became the first person alive to see systemd passing its entire test suite on a big-endian 64-bit PowerPC musl libc system.

Wow :)

By @stuaxo - 8 months
This is great, not just for users of systemd but for systemd itself, and the projects around it getting improved.
By @ducktective - 8 months
Has there ever been an empirical study on the performance hit of switching from glibc to musl?
By @piuantiderp - 8 months
Why even use musl if you're going to use systemd?
By @ghostpepper - 8 months
This was a really well written blog post. I felt like I was able to follow the author's debugging journey very clearly.

Separately I've not heard of Adelie Linux and from a quick glance at their site I can't really tell what niche they're trying to fill. I gather they use musl and (before this post) openRC, and they aim for POSIX compatibility for legacy systems.

By @raverbashing - 8 months
Looking at some patches it seems some of those might just be bugfixes that are inconsequential (or maybe just undetected) on libc?
By @synergy20 - 8 months
both systemd and musl developers were talking here: https://github.com/systemd/systemd/issues/10130

it seemed like a deadlock

By @actionfromafar - 8 months
It must be something in the air. I find flatpak, appimage, snap etc underwhelming. The go reimplementation¹ of appimage looks promising, but it would be nicer if one could more easily link Linux applications statically.

Another idea would be to build a "meta-libc", MIT licensed, which exports a glibc compatible interface but called musl or whatever else libc under the hood for implementation. This is slightly complicated by the fact that musl does not export any version define or symbol.

Or just fork musl and start adding glibc-isms to it...

1: https://github.com/probonopd/go-appimage