Porting systemd to musl libc-powered Linux (catfox.life)
from pnutzh4x0r@lemmy.ndlug.org to linux@lemmy.ml on 05 Sep 2024 13:10
https://lemmy.ndlug.org/post/1076761

I have completed an initial new port of systemd to musl. This patch set does not share much in common with the existing OpenEmbedded patchset. I wanted to make a fully updated patch series targeting more current releases of systemd and musl, taking advantage of the latest features and updates in both. I also took a focus on writing patches that could be sent for consideration of inclusion upstream.

The final result is a system that appears to be surprisingly reliable considering the newness of the port, and very fast to boot.

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.

While the system works really well, and boots in 1/3rd the time of OpenRC on the same system, it isn’t ready for prime time just yet.

There aren’t any service unit files written or packaged yet, other than OpenSSH and utmps. We are working with our sponsor on an effort to add -systemd split packages to any of the packages with -openrc splits. We should be able to rely on upstream units where present, and lean on Gentoo and Fedora’s systemd experts to have good base files to reference when needed. I’ve already landed support for this in abuild.

This work is part of Adélie Linux

#linux

threaded - newest

aport@programming.dev on 05 Sep 2024 15:04 next collapse

This is awesome work, I’m happy to see systemd on musl getting more attention. Poor Khem was doing it all by himself for years.

hornedfiend@sopuli.xyz on 05 Sep 2024 15:52 next collapse

Very very nice work. Thanks for your effort and willingness to experiment with new stuff. i would definitely be interested in trying it out once it reaches “production”.

MigratingtoLemmy@lemmy.world on 05 Sep 2024 17:17 next collapse

What is the aim of this project? Is there a reason why we want to port systemd to distributions which do not want to use glibc?

markstos@lemmy.world on 05 Sep 2024 17:20 next collapse

For all the cases where musk might have advantages.

reddit.com/…/what_are_the_advantages_of_using_mus…

I like that musl helps build smaller containers. And sometimes I need systemd in a container.

khorovodoved@lemm.ee on 05 Sep 2024 17:27 collapse

Systemd bloats the container a lot more than glibc.

markstos@lemmy.world on 05 Sep 2024 19:45 collapse

If I need systemd for a specific use, like testing systemd services, that’s essential, not bloat.

corsicanguppy@lemmy.ca on 06 Sep 2024 04:26 next collapse

If I need systemd for a specific use, like testing systemd services

So you’re hoping to test systemd in this theoretical test environment, but your prod isn’t built like this? Tell us why you’re ignoring the first rule of testing and deploying internal software?

markstos@lemmy.world on 06 Sep 2024 15:27 collapse

The same containers can be used for dev, test and production.

khorovodoved@lemm.ee on 06 Sep 2024 04:56 collapse

I wouldn’t recomend testing any software for glibc system on a musl system.

possiblylinux127@lemmy.zip on 05 Sep 2024 22:39 collapse

Libc has more overhead and attack surface

khorovodoved@lemm.ee on 05 Sep 2024 17:26 next collapse

While I do appreciate the effort, I cannot understand, who in their right mind would use musl and systemd together. For what purpose? If a person was already willing to manage a musl system, why wouldn’t he also prefer sysVinit or runit or whatever?

intelisense@lemm.ee on 05 Sep 2024 17:29 next collapse

My understanding is that it boots faster. That’s a nice thing to have on a container that spins up on demand.

khorovodoved@lemm.ee on 05 Sep 2024 17:31 next collapse

It boots faster than openRC (which is painfully slow). But runit is a lot faster than systemd, and there are init systems even faster than runit. And they all already work with musl. There is even dinit system specifically designed for containers.

LeFantome@programming.dev on 06 Sep 2024 04:08 collapse

What is the name of the dinit system designed for containers?

khorovodoved@lemm.ee on 06 Sep 2024 04:50 collapse

“dinit”

corsicanguppy@lemmy.ca on 06 Sep 2024 04:22 next collapse

My understanding is that it boots faster.

I tested this with EL6 and EL7. There was no discernible difference. It was all theories and brochureware.

PureTryOut@lemmy.kde.social on 06 Sep 2024 07:53 collapse

In general (there are exceptions) containers do not use service managers at all. They start 1 command and that’s it.

tiny@midwest.social on 05 Sep 2024 22:13 next collapse

I want to try alpine out but the lack of systemd support is a blocker since I don’t want to add openrc support to all my Ansible playbooks that rely on systemd services and timers

OhYeah@lemmy.dbzer0.com on 06 Sep 2024 18:15 collapse

It seems like postmarketOS is porting systemd to alpine for their next stable version, just something to keep an eye on

corsicanguppy@lemmy.ca on 06 Sep 2024 04:21 next collapse

I can’t understand anyone wanting that hot mess that is systemd anywhere. I’m only glad lennart went to microsoft so the pruning can begin.

DarkMetatron@feddit.org on 06 Sep 2024 04:47 collapse

There is no indication that anyone will be pruning systemd from distros in the near or far future. Systemd is here to stay and if anything it will only spread into more and more places as can be seen with projects like this.

DarkMetatron@feddit.org on 06 Sep 2024 04:53 next collapse

Maybe because that person uses systemd everywhere else and just doesn’t want the overhead of maintaining two different init systems.

khorovodoved@lemm.ee on 06 Sep 2024 05:35 collapse

He already has the overhead of maintaining to C libraries, which is a lot bigger problem.

DarkMetatron@feddit.org on 06 Sep 2024 05:50 collapse

Well then the answer will most likely be: because they can and want to do it.

PureTryOut@lemmy.kde.social on 06 Sep 2024 07:55 collapse

The reasons for choosing Musl over glibc are largely unrelated for choosing a service manager. You can want one without the other just fine.

Zucca@sopuli.xyz on 05 Sep 2024 17:53 next collapse

I would say “finally”, but I’ve given up already.

I don’t see systems booting with systemd in any near future of any dimension. Instead I now run “terribly slow” OpenRC on my systems. Poor me.

corsicanguppy@lemmy.ca on 06 Sep 2024 04:23 collapse

Instead I now run “terribly slow” OpenRC on my systems.

I suspect you’re entirely free of init problems where you raise your fists to the heavens and ask WHAT ARE YOU DOING as if it’ll tell you why systemd is on holiday now.

[deleted] on 06 Sep 2024 10:36 collapse

.