{"id":8993,"date":"2026-11-05T03:12:32","date_gmt":"2026-11-05T10:12:32","guid":{"rendered":"https:\/\/catbradley.io\/?p=8993"},"modified":"2026-11-05T03:12:32","modified_gmt":"2026-11-05T10:12:32","slug":"systemd-wants-rust-in-but-its-core-will-have-to-wait","status":"publish","type":"post","link":"https:\/\/catbradley.io\/?p=8993","title":{"rendered":"Systemd Wants Rust in, But its Core Will Have to Wait"},"content":{"rendered":"<figure><img decoding=\"async\" src=\"https:\/\/itsfoss.com\/content\/images\/2026\/11\/systemd-rust-banner.png\" alt=\"systemd rust banner\" loading=\"lazy\" \/><\/figure>\n<p><a href=\"https:\/\/systemd.io\/\">systemd<\/a>, the init system and service manager that most mainstream Linux distributions use, has merged support for writing its programs in <a href=\"https:\/\/rust-lang.org\/\">Rust<\/a>. It landed on the main branch through <a href=\"https:\/\/github.com\/systemd\/systemd\/pull\/44324\">a pull request<\/a> of 19 commits.<\/p>\n<p>The pull request replaces an earlier proposal and follows rules the maintainers agreed upon at a recent hackfest in Berlin.<\/p>\n<p>The first program to use it is <code>systemd-keyring-setup<\/code>, and it adds X.509 certificates to kernel keyrings, such as the <a href=\"https:\/\/docs.kernel.org\/admin-guide\/device-mapper\/verity.html\">dm-verity<\/a> and <a href=\"https:\/\/docs.kernel.org\/filesystems\/fsverity.html\">fs-verity<\/a> ones, at boot before locking them down.<\/p>\n<p>If you remember, we recently talked about Amutable <a href=\"https:\/\/itsfoss.com\/news\/amutable-foundations-private-preview\/\">launching a preview<\/a> for their new offering. Anyhow, let&#8217;s see <a href=\"https:\/\/amutable.com\/blog\/systemd-loves-rust\">what they are up to now<\/a>.<\/p>\n<h2>Rust, but on systemd&#8217;s terms<\/h2>\n<p>With the approach they are following, Rust stays optional, and <strong>systemd can still be built without it<\/strong>.<\/p>\n<p>The Rust code&#8217;s scope is limited to new standalone programs that nothing else depends on, while everything builds with <a href=\"https:\/\/mesonbuild.com\/\">meson<\/a>, excluding <a href=\"https:\/\/doc.rust-lang.org\/cargo\/\">cargo<\/a> from the equation. Only the <code>core<\/code> and <code>libc<\/code> crates are allowed, and that rules out the standard library and <code>alloc<\/code>.<\/p>\n<p>Programs would use systemd&#8217;s own <code>Box<\/code> and <code>Vec<\/code> types, and a failed allocation would return an error instead of panicking. A Rust program must also behave like its C counterparts, with a test checking this for programs that declare the same command.<\/p>\n<p>Building Rust programs involves having <em>rustc 1.85<\/em>, <em>bindgen 0.71.1<\/em>, and <em>meson 1.4.0<\/em> or newer.<\/p>\n<p>Distributions that build systemd with every feature enabled, such as Arch and openSUSE OBS, will have to install the Rust toolchain or turn Rust support off.<\/p>\n<h2>The shared library problem<\/h2>\n<p>The library that systemd&#8217;s programs share, <code>libsystemd-shared<\/code>, stays in C for now. Putting Rust in it would need proper shared library support from Rust itself, and the language still has no <a href=\"https:\/\/github.com\/rust-lang\/rfcs\/issues\/600\">stable ABI<\/a>.<\/p>\n<p>Rust programs use that C library the same way C programs do, and putting Rust inside it would duplicate the same code across the library and many of systemd\u2019s binaries.<\/p>\n<p><strong>Filesystem access is another hurdle<\/strong>, since systemd looks up paths through file descriptors to keep that step secure and does not accept Rust&#8217;s standard path handling for its sensitive components. It would like Rust to support that approach as well.<\/p>\n<p>systemd still wants Rust in its core and says <strong>it is open to work with the Rust community<\/strong> to get there.<\/p>\n<h2>A wave of rust<\/h2>\n<p>systemd is not the only part of the Linux stack making room for Rust.<\/p>\n<p>The memory-safe language entered the Linux kernel with 6.1 as an exploratory effort, with the kernel maintainers declaring late last year that <a href=\"https:\/\/lore.kernel.org\/lkml\/20251213000042.23072-1-ojeda@kernel.org\/\">the experiment was over<\/a>.<\/p>\n<p>Ubuntu has been taking the same route with its core tools since some time now, when <a href=\"https:\/\/itsfoss.com\/news\/ubuntu-25-10-sudo-rs\/\">sudo-rs<\/a> and <a href=\"https:\/\/itsfoss.com\/news\/ubuntu-rustification-coreutils-migration\/\">uutils coreutils<\/a> became the default experiences.<\/p>\n<p>All that strongly suggests that the adoption of Rust will only accelerate as we go into a very busy 2027.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/feed.itsfoss.com\/link\/24361\/17515808.gif\" height=\"1\" width=\"1\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>systemd, the init system and service manager that most mainstream Linux distributions use, has merged support for writing its programs in Rust. It landed on the main branch through a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":[],"rop_publish_now_history":[],"rop_publish_now_status":"pending","footnotes":""},"categories":[1],"tags":[],"class_list":["post-8993","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rss"],"_links":{"self":[{"href":"https:\/\/catbradley.io\/index.php?rest_route=\/wp\/v2\/posts\/8993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/catbradley.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/catbradley.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/catbradley.io\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/catbradley.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8993"}],"version-history":[{"count":0,"href":"https:\/\/catbradley.io\/index.php?rest_route=\/wp\/v2\/posts\/8993\/revisions"}],"wp:attachment":[{"href":"https:\/\/catbradley.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/catbradley.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/catbradley.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}