about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorTyler Langlois <tjl@byu.net>2022-11-21 13:43:28 -0700
committerTyler Langlois <tjl@byu.net>2022-11-21 13:43:28 -0700
commite217979fc7696486cd6445224ffe8700f18dfe70 (patch)
treefc880afa1af4852218618235ac7fec198f08fbde /nixos
parent16bc8a29d67f6c4ba66660e91f69164400ee6ee1 (diff)
downloadnixlib-e217979fc7696486cd6445224ffe8700f18dfe70.tar
nixlib-e217979fc7696486cd6445224ffe8700f18dfe70.tar.gz
nixlib-e217979fc7696486cd6445224ffe8700f18dfe70.tar.bz2
nixlib-e217979fc7696486cd6445224ffe8700f18dfe70.tar.lz
nixlib-e217979fc7696486cd6445224ffe8700f18dfe70.tar.xz
nixlib-e217979fc7696486cd6445224ffe8700f18dfe70.tar.zst
nixlib-e217979fc7696486cd6445224ffe8700f18dfe70.zip
nixos/rpcbind: add dependency for systemd-tmpfiles-setup
The inline comments explain the reasoning behind this change. This
work was initiated due to failing tests explicitly for glusterfs, but
my hunch is that any nixosTest adjacent to rpcbind will start working
again.

Ref: https://github.com/NixOS/nixpkgs/issues/175339
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/rpcbind.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/rpcbind.nix b/nixos/modules/services/networking/rpcbind.nix
index aa04214debb0..60e78dfec51b 100644
--- a/nixos/modules/services/networking/rpcbind.nix
+++ b/nixos/modules/services/networking/rpcbind.nix
@@ -35,6 +35,16 @@ with lib;
 
     systemd.services.rpcbind = {
       wantedBy = [ "multi-user.target" ];
+      # rpcbind performs a check for /var/run/rpcbind.lock at startup
+      # and will crash if /var/run isn't present. In the stock NixOS
+      # var.conf tmpfiles configuration file, /var/run is symlinked to
+      # /run, so rpcbind can enter a race condition in which /var/run
+      # isn't symlinked yet but tries to interact with the path, so
+      # controlling the order explicitly here ensures that rpcbind can
+      # start successfully. The `wants` instead of `requires` should
+      # avoid creating a strict/brittle dependency.
+      wants = [ "systemd-tmpfiles-setup.service" ];
+      after = [ "systemd-tmpfiles-setup.service" ];
     };
 
     users.users.rpc = {