summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2017-02-05 02:10:57 +0300
committerNikolay Amiantov <ab@fmap.me>2017-02-05 03:17:38 +0300
commit5b043ea3614cacff75984f96b9bdd7df770450f3 (patch)
treef0de07c11a8ace61b2531053e11e3f3ce10dc7e7
parent1e2ce1fffba4606011e7ed947b69041df587e059 (diff)
downloadnixpkgs-5b043ea3614cacff75984f96b9bdd7df770450f3.tar
nixpkgs-5b043ea3614cacff75984f96b9bdd7df770450f3.tar.gz
nixpkgs-5b043ea3614cacff75984f96b9bdd7df770450f3.tar.bz2
nixpkgs-5b043ea3614cacff75984f96b9bdd7df770450f3.tar.lz
nixpkgs-5b043ea3614cacff75984f96b9bdd7df770450f3.tar.xz
nixpkgs-5b043ea3614cacff75984f96b9bdd7df770450f3.tar.zst
nixpkgs-5b043ea3614cacff75984f96b9bdd7df770450f3.zip
nfs service: create state directories
-rw-r--r--nixos/modules/services/network-filesystems/nfsd.nix7
-rw-r--r--nixos/modules/tasks/filesystems/nfs.nix5
2 files changed, 12 insertions, 0 deletions
diff --git a/nixos/modules/services/network-filesystems/nfsd.nix b/nixos/modules/services/network-filesystems/nfsd.nix
index 4fafb7a1fdb..a0368f1280a 100644
--- a/nixos/modules/services/network-filesystems/nfsd.nix
+++ b/nixos/modules/services/network-filesystems/nfsd.nix
@@ -130,6 +130,11 @@ in
     systemd.services.nfs-server =
       { enable = true;
         wantedBy = [ "multi-user.target" ];
+
+        preStart =
+          ''
+            mkdir -p /var/lib/nfs/v4recovery
+          '';
       };
 
     systemd.services.nfs-mountd =
@@ -139,6 +144,8 @@ in
 
         preStart =
           ''
+            mkdir -p /var/lib/nfs
+
             ${optionalString cfg.createMountPoints
               ''
                 # create export directories:
diff --git a/nixos/modules/tasks/filesystems/nfs.nix b/nixos/modules/tasks/filesystems/nfs.nix
index 692034c0e37..73cf18384bd 100644
--- a/nixos/modules/tasks/filesystems/nfs.nix
+++ b/nixos/modules/tasks/filesystems/nfs.nix
@@ -91,6 +91,11 @@ in
 
     systemd.services.rpc-statd =
       { restartTriggers = [ nfsConfFile ];
+
+        preStart =
+          ''
+            mkdir -p /var/lib/nfs/{sm,sm.bak}
+          '';
       };
 
   };