A systemd-compatible service manager written in Rust
README.md

Oxidized Systemd #

Part of the overby.me monorepo, where this lives in safety/oxidized/systemd and where all development happens.

It is also published on its own, as tangled.org/overby.me/oxidized-systemd and github.com/overby-me/oxidized-systemd. Both are read-only mirrors, rebuilt from the monorepo with josh: a commit made to either is overwritten by the next sync, so please open issues and pull requests on the monorepo.

A pure Rust rewrite and drop-in replacement for systemd.

Binary-for-binary compatible: same binary names, same paths, same D-Bus interfaces, same socket protocols, same file formats. Existing unit files, configuration and tooling are meant to work unmodified. The implementation follows the C reference implementation's architecture rather than reimagining it.

Status #

NixOS boots with oxidized-systemd as PID 1 and reaches multi-user.target with a login prompt in about 6 seconds under cloud-hypervisor, with networking via networkd and resolved.

  • 93 crates, roughly 370,000 lines of Rust
  • About 9,700 unit test functions
  • 440 upstream systemd integration tests registered; 37 still carry a real override

The gap lists are docs/TEST-OVERRIDES.md (functional) and docs/ARCHITECTURE.md (structural). Neither is optimistic; read them before trusting a green check.

Design principles #

  1. Drop-in compatible. Every binary, D-Bus interface, socket protocol, file format and CLI flag matches systemd behaviour.
  2. No C dependencies. Pure Rust with direct syscalls via nix/rustix. No libsystemd, libdbus, libudev.
  3. Same binary names. Installs as systemd, systemctl, journalctl, systemd-journald and so on, at the same paths, so package managers and other software find them.
  4. Safe by default. The type system rules out the memory-safety bug classes that have historically affected systemd.
  5. Incremental adoption. Components can be swapped in one at a time: rust journald under C PID 1, or the reverse.

Building #

cargo build --release                  # whole workspace
cargo build --release -p systemd       # just PID 1
cargo build --release -p systemctl
just build

Testing #

cargo test --workspace                                       # unit tests
just difftest                                                # vs real systemd
nix build .#checks.x86_64-linux.oxidized-systemd-test-01-basic -L # one integration test

Never run plain nix flake check in this repo: it OOMs. Use just check.

See docs/TESTING.md for the integration harness, the C systemd oracle, and how to debug early boot failures.

Layout #

crates/
├── libsystemd/     # core: unit parsing, dependency graph, sd_notify, socket activation,
│                   # journal format and storage, cgroups, exec context, platform layer
├── systemd/        # PID 1 service manager
├── systemctl/      # control tool
├── journald/       # journal daemon        journalctl/  # journal query
├── udevd/          # device manager        udevadm/     # udev administration
├── logind/         # sessions and seats    networkd/    # network configuration
├── resolved/       # DNS                   ...

93 crates in total. Full inventory in docs/ROADMAP.md.

Documentation #

File Contents
docs/TESTING.md How to run every test layer; harness mechanics; boot debugging
docs/TEST-OVERRIDES.md Every place a test is weakened or skipped, and what it needs
docs/ARCHITECTURE.md The PID 1 concurrency model, its divergence from upstream, and the open invariants
docs/EVENT-LOOP.md The jobs-plus-dispatcher convergence design and its seven migration increments
docs/ROADMAP.md Component inventory, directive coverage, differential-testing plan
CHANGELOG.md Change history

Contributing #

Good starting points, in rough order of value:

  1. Pick an entry from docs/TEST-OVERRIDES.md Tier 1. Removing an override and recording the real failure is the cheapest useful contribution.
  2. Work on one of the open invariants in docs/ARCHITECTURE.md. These retire whole hang classes rather than single tests.
  3. Add missing unit-file directives (see the coverage table in the roadmap).
  4. Implement a missing component: systemd-importd, systemd-storagetm, systemd-sysupdate.

Coding conventions #

D-Bus: zbus only. Do not add dbus or dbus-crossroads; the project moved off those C-backed crates to eliminate libdbus initialization failures in sandboxes.

  • Define interfaces with #[zbus::interface] on impl blocks.
  • Use zbus::blocking::Connection for synchronous connections.
  • Use zbus::object_server::SignalEmitter, not the deprecated SignalContext.
  • Use zbus::blocking::fdo::DBusProxy for name ownership and signal subscription.

Locking. Read docs/ARCHITECTURE.md before touching PID 1's activation path. Holding the RuntimeInfo guard across a blocking call is the single most common way to wedge the manager.

License #

See LICENSE.