From 2b06a92c2a113f70b1c07a5be3e53a2f229f379b Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Mon, 1 Dec 2014 17:17:46 -0800 Subject: nixos/nfs: Fix dependency ordering --- nixos/modules/system/boot/systemd.nix | 5 +++++ nixos/modules/tasks/filesystems/nfs.nix | 8 +++++--- nixos/tests/nfs.nix | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 64667acf1277..80208c1525d5 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -947,6 +947,11 @@ in systemd.targets.network-online.after = [ "ip-up.target" ]; + systemd.targets.remote-fs-pre = { + wantedBy = [ "remote-fs.target" ]; + before = [ "remote-fs.target" ]; + }; + systemd.units = mapAttrs' (n: v: nameValuePair "${n}.target" (targetToUnit n v)) cfg.targets // mapAttrs' (n: v: nameValuePair "${n}.service" (serviceToUnit n v)) cfg.services diff --git a/nixos/modules/tasks/filesystems/nfs.nix b/nixos/modules/tasks/filesystems/nfs.nix index 45c1119215e5..546145e54ac7 100644 --- a/nixos/modules/tasks/filesystems/nfs.nix +++ b/nixos/modules/tasks/filesystems/nfs.nix @@ -73,9 +73,10 @@ in path = [ pkgs.nfsUtils pkgs.sysvtools pkgs.utillinux ]; - wantedBy = [ "multi-user.target" ]; + wantedBy = [ "remote-fs-pre.target" ]; + before = [ "remote-fs-pre.target" ]; requires = [ "basic.target" "rpcbind.service" ]; - after = [ "basic.target" "rpcbind.service" "network.target" ]; + after = [ "basic.target" "rpcbind.service" ]; unitConfig.DefaultDependencies = false; # don't stop during shutdown @@ -99,7 +100,8 @@ in path = [ pkgs.sysvtools pkgs.utillinux ]; - wantedBy = [ "multi-user.target" ]; + wantedBy = [ "remote-fs-pre.target" ]; + before = [ "remote-fs-pre.target" ]; requires = [ "rpcbind.service" ]; after = [ "rpcbind.service" ]; diff --git a/nixos/tests/nfs.nix b/nixos/tests/nfs.nix index 61b2431c04c7..3a6ea7701c4e 100644 --- a/nixos/tests/nfs.nix +++ b/nixos/tests/nfs.nix @@ -38,7 +38,7 @@ in testScript = '' $server->waitForUnit("nfsd"); - $server->waitForUnit("network.target"); + $server->waitForUnit("network-online.target"); startAll; -- cgit 1.4.1