From 163ed5264b7b52c94b21a6215d04f5743ee706ce Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 16 Jul 2013 13:48:52 +0200 Subject: [PATCH] Start sm-notify/statd atfer nfsd The README of nfs-utils explains that we must not notify clients before nfsd is running, otherwise they may fail to reclaim their locks. OTOH it's allowed but not required to start "rpc.statd --no-notify" before nfsd. So for simplicity we do both after starting nfsd. --- modules/services/network-filesystems/nfsd.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/services/network-filesystems/nfsd.nix b/modules/services/network-filesystems/nfsd.nix index ab8e77e2bad..4daa5e9d063 100644 --- a/modules/services/network-filesystems/nfsd.nix +++ b/modules/services/network-filesystems/nfsd.nix @@ -86,7 +86,8 @@ in wantedBy = [ "multi-user.target" ]; requires = [ "rpcbind.service" "mountd.service" ]; - after = [ "rpcbind.service" "mountd.service" "statd.service" ]; + after = [ "rpcbind.service" "mountd.service" "idmapd.service" ]; + before = [ "statd.service" ]; path = [ pkgs.nfsUtils ]; @@ -98,8 +99,6 @@ in rpc.nfsd \ ${if cfg.hostName != null then "-H ${cfg.hostName}" else ""} \ ${builtins.toString cfg.nproc} - - sm-notify -d ''; postStop = "rpc.nfsd 0"; @@ -133,13 +132,13 @@ in '' } - exportfs -ra + exportfs -rav ''; restartTriggers = [ exports ]; serviceConfig.Type = "forking"; - serviceConfig.ExecStart = "@${pkgs.nfsUtils}/sbin/rpc.mountd rpc.mountd -f /etc/exports"; + serviceConfig.ExecStart = "@${pkgs.nfsUtils}/sbin/rpc.mountd rpc.mountd"; serviceConfig.Restart = "always"; };