mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-12 10:43:16 +01:00
Before this change, systemd-oomd startup was flaky at least with
either systemd-sysusers or userborn enabled. It would restart several
times until users were provisioned, so that it finally succeeded.
An alternative would be to use a DynamicUser which was my first
approach, before I discovered that upstream added the after statement
in Dec 2024[1]. DynamicUsers could have further
implications (sandboxing, etc), so we follow upstream here.
It's not clear to me we why Upstreams "After=systemd-sysusers.service"
doesn't show up on nixos-unstable systems (systemd v257.6).
Userborn is covered, as its unit is aliased to systemd-sysusers.service.
The following test succeeded after this change on x86_64-linux:
nix-build -A nixosTests.systemd-oomd
[1]:
|
||
|---|---|---|
| .. | ||
| coredump.nix | ||
| dm-verity.nix | ||
| fido2.nix | ||
| homed.nix | ||
| initrd-secrets.nix | ||
| initrd.nix | ||
| journald-gateway.nix | ||
| journald-remote.nix | ||
| journald-upload.nix | ||
| journald.nix | ||
| logind.nix | ||
| nspawn.nix | ||
| oomd.nix | ||
| repart.nix | ||
| shutdown.nix | ||
| sysupdate.nix | ||
| sysusers.nix | ||
| tmpfiles.nix | ||
| tpm2.nix | ||
| user.nix | ||
| userdbd.nix | ||