From 5b043ea3614cacff75984f96b9bdd7df770450f3 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sun, 5 Feb 2017 02:10:57 +0300 Subject: [PATCH] nfs service: create state directories --- nixos/modules/services/network-filesystems/nfsd.nix | 7 +++++++ nixos/modules/tasks/filesystems/nfs.nix | 5 +++++ 2 files changed, 12 insertions(+) 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} + ''; }; };