summary refs log tree commit diff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2020-02-23 18:53:52 -0500
committerworldofpeace <worldofpeace@protonmail.ch>2020-02-23 18:53:52 -0500
commitfa7615023554f6ab140ee0cd7728551beb3be56c (patch)
treebca8b279ae5d1375b008ca38fc857f6523525dfe
parentc0c1f118891a6ab977e20f3aab4fdc4dd3d88af4 (diff)
downloadnixpkgs-fa7615023554f6ab140ee0cd7728551beb3be56c.tar
nixpkgs-fa7615023554f6ab140ee0cd7728551beb3be56c.tar.gz
nixpkgs-fa7615023554f6ab140ee0cd7728551beb3be56c.tar.bz2
nixpkgs-fa7615023554f6ab140ee0cd7728551beb3be56c.tar.lz
nixpkgs-fa7615023554f6ab140ee0cd7728551beb3be56c.tar.xz
nixpkgs-fa7615023554f6ab140ee0cd7728551beb3be56c.tar.zst
nixpkgs-fa7615023554f6ab140ee0cd7728551beb3be56c.zip
nixos/rngd: fix clean shutdown
It seems disabling DefaultDependencies
removes these implicit dependencies [0] that
we needed for shutdown to happen cleanly.

Fixes #80871

[0]: https://www.freedesktop.org/software/systemd/man/systemd.service.html#Default%20Dependencies
-rw-r--r--nixos/modules/security/rngd.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/nixos/modules/security/rngd.nix b/nixos/modules/security/rngd.nix
index 5566c53897d..cffa1a5849f 100644
--- a/nixos/modules/security/rngd.nix
+++ b/nixos/modules/security/rngd.nix
@@ -37,6 +37,13 @@ in
 
       after = [ "dev-random.device" ];
 
+      # Clean shutdown without DefaultDependencies
+      conflicts = [ "shutdown.target" ];
+      before = [
+        "sysinit.target"
+        "shutdown.target"
+      ];
+
       description = "Hardware RNG Entropy Gatherer Daemon";
 
       # rngd may have to start early to avoid entropy starvation during boot with encrypted swap