mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-13 11:15:37 +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]:
|
||
|---|---|---|
| .. | ||
| loader | ||
| systemd | ||
| binfmt.nix | ||
| clevis.md | ||
| clevis.nix | ||
| emergency-mode.nix | ||
| grow-partition.nix | ||
| initrd-network.nix | ||
| initrd-openvpn.nix | ||
| initrd-ssh.nix | ||
| kernel.nix | ||
| kernel_config.nix | ||
| kexec.nix | ||
| luksroot.nix | ||
| modprobe.nix | ||
| networkd.nix | ||
| nix-store-veritysetup.nix | ||
| pbkdf2-sha512.c | ||
| plymouth.nix | ||
| resolved.nix | ||
| shutdown.nix | ||
| stage-1-init.sh | ||
| stage-1.nix | ||
| stage-2-init.sh | ||
| stage-2.nix | ||
| stratisroot.nix | ||
| systemd.nix | ||
| timesyncd.nix | ||
| tmp.nix | ||
| uki.nix | ||
| unl0kr.nix | ||
| uvesafb.nix | ||
| zram-as-tmp.nix | ||