From 98a2316166cbb4e9dc87e35d07dd520acb362ef2 Mon Sep 17 00:00:00 2001 From: Ruben Maher Date: Mon, 18 Sep 2017 19:12:40 +0930 Subject: [PATCH] nfs-utils: set /etc/krb5.keytab as default path for rpc-gssd Currently the `rpc-gssd.service` has a `ConditionPathExists` clause that can never be met, because it's looking for stateful data inside `/nix/store`. `auth-rpcgss-module.service` also only starts if this file exists. Fixes NixOS/nixpkgs#29509. --- nixos/modules/tasks/filesystems/nfs.nix | 6 ++++++ pkgs/os-specific/linux/nfs-utils/default.nix | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/tasks/filesystems/nfs.nix b/nixos/modules/tasks/filesystems/nfs.nix index 73cf18384bd4..d3a558738f4b 100644 --- a/nixos/modules/tasks/filesystems/nfs.nix +++ b/nixos/modules/tasks/filesystems/nfs.nix @@ -85,8 +85,14 @@ in enable = mkDefault false; }; + systemd.services.auth-rpcgss-module = + { + unitConfig.ConditionPathExists = [ "" "/etc/krb5.keytab" ]; + }; + systemd.services.rpc-gssd = { restartTriggers = [ nfsConfFile ]; + unitConfig.ConditionPathExists = [ "" "/etc/krb5.keytab" ]; }; systemd.services.rpc-statd = diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix index d28cf44bd67a..294dde2a0a69 100644 --- a/pkgs/os-specific/linux/nfs-utils/default.nix +++ b/pkgs/os-specific/linux/nfs-utils/default.nix @@ -39,7 +39,7 @@ in stdenv.mkDerivation rec { sed -i "s,^PATH=.*,PATH=$out/bin:${statdPath}," utils/statd/start-statd configureFlags="--with-start-statd=$out/bin/start-statd $configureFlags" - + substituteInPlace systemd/nfs-utils.service \ --replace "/bin/true" "${coreutils}/bin/true"