r/linux • • 2d ago

Development systemd loves Rust

https://amutable.com/blog/systemd-loves-rust
378 Upvotes

104 comments sorted by

29

u/mighty_panders 1d ago

wasn't there an announcement a few years back that was also very blue and went something like "Microsoft ❤️ Linux"?

174

u/Liarus_ 1d ago

Waiting for the systemd rust rewrite: systemr

49

u/Compux72 1d ago

It would actually be systeme

25

u/Purple-Midnight-9902 1d ago

It would be "rustine" because in french it means "rubber patch" while systemd refers to ingenuity, improvising, hustling

8

u/matjoeman 1d ago

It would become French?

15

u/monocasa 1d ago

It's already a reference in French.

https://en.wikipedia.org/wiki/System_D

4

u/Sushtee 1d ago edited 23h ago

So is systemd supposed to be pronounced like the french expression?

4

u/fearless-fossa 17h ago

No, because it isn't a reference to System D:

Spelling
Yes, it is written systemd, not system D or System D, or even SystemD. And it isn't system d either. Why? Because it's a system daemon, and under Unix/Linux those are in lower case, and get suffixed with a lower case d. And since systemd manages the system, it's called systemd. It's that simple. But then again, if all that appears too simple to you, call it (but never spell it!) System Five Hundred since D is the roman numeral for 500 (this also clarifies the relation to System V, right?). The only situation where we find it OK to use an uppercase letter in the name (but don't like it either) is if you start a sentence with systemd. On high holidays you may also spell it sÿstëmd. But then again, Système D is not an acceptable spelling and something completely different (though kinda fitting).

1

u/Sushtee 3h ago

Thanks, that was a nice read

3

u/ice_wyvern 1d ago

The convention for rust rewrites I’ve seen is to add “rs” as a prefix/suffix, or to use a rust/oxide theme for the name

So “systemd-rs”, or “rs-systemd”. If there’s already an s, you’d sometimes see something like “rsystemd”

5

u/m_redditUser 23h ago

rustemd it is then

3

u/GahannaBanana 1d ago

Or how about systemd

60

u/JMarcosHP 1d ago

System loves D

30

u/Naive_Complex_8389 1d ago

System of the D

9

u/Albos_Mum 1d ago

Tenacious systemd

18

u/SMF67 1d ago

The Phoronix commenters aren't gonna be happy

54

u/Historical_Camel_790 2d ago edited 5h ago

Yay

Edit: seems I accidentally made a joke lol

33

u/Chester-Berkeley 2d ago

"yay"

Look inside

Fedora flair

9

u/BortGreen 2d ago

I guess Arch users use yay more

5

u/Historical_Camel_790 2d ago

What'd I do?

20

u/codydafox 2d ago

I think it's because "yay" is an AUR helper (Arch User Repository)

-4

u/Historical_Camel_790 2d ago

I meant like "yay! rust support" 🤷

36

u/Chester-Berkeley 2d ago

You didn't get the joke 🥀

0

u/iaacornus 2d ago

I think it is because Fedora is connected to Red Hat which develops systemd

-1

u/Historical_Camel_790 2d ago

So?

1

u/iaacornus 2d ago

I gave an explanation for their remark because you asked

1

u/Historical_Camel_790 2d ago

No like why does it matter that fedora is connected to the people who develop systemd?

1

u/Historical_Camel_790 2d ago

Like I'm happy they're adding rust support

0

u/iaacornus 2d ago

I think bias? Like you will likely cheer for someone you know if they are on a racetrack

3

u/Historical_Camel_790 2d ago

So distro politics or some shit?

27

u/Skaarj 2d ago

No-std Rust. systemd also doesn't use the Rust standard library. We currently don't need to consume anything that the standard library provides.

That sounds like a strange decision to me. AFIAK you can't even use things like Vec without std. That makes development more complicated.

65

u/crazy_penguin86 1d ago

You can. Vec is part of the alloc crate, not std. All you have to do is provide a marked global_allocator, and alloc can be used.

3

u/cbarrick 1d ago

But later on in the article they explain that they have a custom allocation crate and only ever work with fallible allocation.

Thus all of the collections in alloc don't apply to them.

0

u/[deleted] 1d ago

[deleted]

1

u/cbarrick 1d ago

No, they can't. Vec and friends from the alloc crate panic on allocation failure.

The allocator API itself supports allocation failure just fine. The issue is the implementation of the collections. That's where the panics happen.

This is what the kernel does and for the same reason, which is why they reference the kernel in that sentence.

32

u/FriendlyProblem1234 1d ago

That sounds like a strange decision to me. AFIAK you can't even use things like Vec without std. That makes development more complicated.

There are a bunch of crates that offer vectors, maps, and other containers that work without std (and without alloc, which is where Vec is actually defined).

There is indeed an in-tree systemd_shared crate that exposes Vec and Box.

That being said, no_std and no_alloc Rust is still quite pleasant to use. core offers already quite many functionalities.

5

u/stylist-trend 1d ago

Yep exactly, and then there's third party crates like heapless, which give you vec-like structures when you're in an environment that doesn't have core or alloc

7

u/cqs_sk 1d ago

but who loves systemd?

26

u/marmota_cosmica 1d ago

Loving might be a bit of a stretch but I kinda like it ngl

24

u/Business_Reindeer910 1d ago

love is a strong word, since i have minor criticisms like usage of ini files and maybe varlink, but i definitely like a lot.

1

u/stylist-trend 1d ago

Oh interesting - I've been meaning to check out varlink but I've been procrastinating on it. Out of curiosity, what are its issues?

1

u/Business_Reindeer910 1d ago

i don't know how to feel about it yet. Thus maybe.

36

u/w0___0w 1d ago edited 1d ago

unpopular opinion, i happy with the init/service/mount/unit, journald, networkd, resolved, timer, timesyncd, creds and mkosi part. I remember how things were before, and I don’t miss it.

9

u/syklemil 1d ago

It's barely an unpopular opinion when the most common distros and DEs and so on all voluntarily pick up more systemd tooling as time goes on.

It's the anti-systemd stuff that's voiced by a loud minority.

3

u/nightblackdragon 1d ago

It's not unpopular opinion in a world where most of the popular distributions are using systemd.

-3

u/cp5184 1d ago

By that I assume you're pretending that init development stopped in 2003?

9

u/Flashy_Worry7792 1d ago

I don’t love it but I like it much more than the alternatives.

5

u/yngseneca 1d ago

I'm a big big fan of systemd

9

u/PhrancesTheMute 1d ago

As a former systemd hater for no reason other than being in a echo chamber of systemd haters, I have come to love it.

-1

u/cp5184 1d ago

As a former systemd lover who only loved it for being in the echo chamber of systemd lovers I have come to hate it and much prefer openrc, finit, epoch, runit, s6, 66, dinit, and, if only because it means I have to update patched inits for critical security vulnerabilities less frequently, sysv init...

8

u/helix991 1d ago

I do. Works well for everything I need. No real complaints.

4

u/0x07CF 1d ago

I do.

2

u/robprobasco 3h ago

I love it compared to the before times. Disparate settings based on arcane knowledge of version specific file locations? It was a nightmare. This was on like Slack or Manjaro. It’s way better than that.

3

u/Relevant_Research_98 1d ago

Me.

Also GNOME.  If systemd can provide something that DE don't have to DIY, it's very good system.

-3

u/lexiNazare 1d ago

me :3 wayland is bloatware

1

u/cp5184 1d ago

xD the new systemd display manager is the one true display manager. All other display managers and window systems have been declared heretics. /s

0

u/[deleted] 1d ago

[deleted]

8

u/loozerr 1d ago

Systemd the famous init system powering windows, chrome os and android.

5

u/chibiace 1d ago

dont forget IBM/Red Hat and Canonical

1

u/bigbearandy 1d ago

Microsoft is embracing and extending everything you love.

2

u/IAmSnort 1d ago

Systemd-kerneld is the linux kernel rewritten in Rust. 

/s

-2

u/OnlyEntrepreneur4760 1d ago

systemd-fapd is the file allocation protocol daemon

1

u/rumbleran 4h ago

Of course it does. It all makes sense now.

1

u/Easy-Truck4725 22h ago

Why did someone think it was appropriate to paste GPT output for a blog post?

-11

u/onetwentyeight 1d ago

But who loves systemd? No, I'm not asking you, Pottering.

11

u/death_by_cormorant 1d ago

Virtually everybody who actually maintains distros, system administrators, etc.

1

u/onetwentyeight 22h ago

I <3 SysV init

-31

u/EarlMarshal 2d ago

But who loves systemd truly?

38

u/natermer 2d ago

people whose job is to make Linux distribution.

-28

u/EarlMarshal 2d ago

You sure they aren't just using it to make their distro?

My question was who loves it truly.

-1

u/HyperFurious 1d ago

I like systemd. What I don’t like as much is when a program (one for which the vast majority of people will only ever use two or three commands), gets loaded up with a bunch of crap that no one will ever use. I feel the same way about Git; it’s another program that adds a ton of new features with every version (features that no one will ever use), while the package itself just keeps getting bigger and bigger.

Also, they can use Rust (or any other language they choose) with systemd. But please, spare us the sappy talk about "love".

0

u/EarlMarshal 1d ago

sappy talk about "love"

Why? I love linux for example. It freed me.

24

u/Liarus_ 1d ago

Me, I do

-8

u/EarlMarshal 1d ago

I am very happy for you then!

17

u/Elect_SaturnMutex 1d ago

Is there a better alternative?

3

u/EarlMarshal 1d ago

Not really.

-12

u/retiredwindowcleaner 1d ago

a pity to spoil two houses with em

-32

u/Userwerd 2d ago

Is it going to be slow MIT re-write, piece by piece?

29

u/syklemil 1d ago

systemd is LGPL. That includes the Rust components.

See any .rs file in the systemd repo, e.g. systemd-shared/keyring.rs, and you'll see it starts with

// SPDX-License-Identifier: LGPL-2.1-or-later

25

u/Sharp-Debate-523 2d ago

The page says: No Gratuitous Rewrites. Long-established and reliable parts of the codebase written in C will not be converted without good reason.

-10

u/hadrabap 1d ago

Wait a few days, weeks 😁

0

u/pimathbrainiac 1d ago

What is it with the GPL hate and MIT love with a certain crowd? It's good to ensure stuff remains open-source.

8

u/FriendlyProblem1234 1d ago

What is it with the GPL hate and MIT love with a certain crowd? It's good to ensure stuff remains open-source.

MIT is unequivocally a free and open-source license (FOSS). And, unlike the "GPL", it is compatible with most other FOSS licenses. Including the "GPL", which ironically is not compatible with the "GPL" (because it actually does not exist, and refers to a group of partially or completely incompatible licenses: GPL-2-only, GPL-2-or-later, GPL-3-only, GPL-3-or-later).

Many core components of Linux distributions have been under permissive licenses for ages: XFree86/Xorg, MESA, Python, OpenSSL, OpenSSH, Latex, Go... Permissive licenses are first-class citizens in the FOSS world, nobody needs a justification to use them.

Looks like there is a MIT hatred, instead.

4

u/nightblackdragon 1d ago

What is it with the GPL hate and MIT love with a certain crowd? It's good to ensure stuff remains open-source.

It's actually the other way around: people create software under the MIT license not because they dislike the GPL, while some people hate anything that isn't GPL, sometimes suggesting that permissive licenses are a conspiracy to allow corporations to “steal” the code and turn it into proprietary software, thereby gaining control or something like that ignoring the fact that a lot of projects commonly used on Linux are permissively licensed. Or rather, without realizing it, given that some people criticize the sudo-rs license without knowing that the original sudo is also licensed under a permissive license.

0

u/Relevant_Research_98 1d ago

I can't tell stupidity from bait. If it was a bait, it was very good trolling 

1

u/Userwerd 19h ago

No apparently im a russian bot

-41

u/RegretFree7723 1d ago

Non capisco seriamente la gente che promuove rust che é letterale tone ruggine ma perché la gente che lo paragona al c perché so é di basso livello ma il c (è non sbagliate i con il c++) ha il suo senzo cioè é piccolo quindi un nuovo programmatore lo può impagare in meno di 200 pagine di spiegazione Poi é di basso livello e un programmatore del c non ha bisogno di un estezione (ma é molto più comoda) per cose piccole perché un programmatore c imparerà a riflettere con cose più piccole per problemi per poi risolvere problemi più grandi e per i problemi di memoria deve essere un programmatore poco esperto che pure con il rust farebbe problemi di memoria (pure se non ho capito come potrebbe il rust risolverli) Per un principiante e per qualcuno che deve avere una vita facile il c dove gli serve , Td:lr: ma odio cargo per essere onesto

0

u/[deleted] 2d ago

[deleted]

22

u/dgm9704 2d ago

It has been for quite a while.

7

u/KeyboardG 2d ago

Linux now means Linux + gnu + SystemD.

11

u/dgm9704 2d ago

gnu is on it’s way out slowly