Author: eelco Date: 2010-06-08 16:01:31 +0000 (Tue, 08 Jun 2010) New Revision: 22187
You can view the changes in this commit at: https://svn.nixos.org/viewvc/nix?rev=22187&view=rev Modified: nixos/branches/boot-order/modules/services/network-filesystems/nfs-kernel.nix nixos/branches/boot-order/modules/tasks/filesystems.nix Log: * nfsd: run rpc.nfsd from the pre-start script since it's not actually a daemon (it just starts some kernel threads). In the post-stop script, stop the kernel threads. * exportfs: fix the createMountPoints option. * Mount the nfsd filesystem on /proc/fs/nfsd because mountd prefers this. Changes: Modified: nixos/branches/boot-order/modules/services/network-filesystems/nfs-kernel.nix =================================================================== --- nixos/branches/boot-order/modules/services/network-filesystems/nfs-kernel.nix 2010-06-08 13:38:28 UTC (rev 22186) +++ nixos/branches/boot-order/modules/services/network-filesystems/nfs-kernel.nix 2010-06-08 16:01:31 UTC (rev 22187) @@ -8,6 +8,8 @@ cfg = config.services.nfsKernel; + exports = pkgs.writeText "exports" cfg.server.exports; + in { @@ -82,7 +84,7 @@ }); environment.etc = mkIf cfg.server.enable (singleton - { source = pkgs.writeText "exports" cfg.server.exports; + { source = exports; target = "exports"; }); @@ -100,19 +102,23 @@ '' export PATH=${pkgs.nfsUtils}/sbin:$PATH mkdir -p /var/lib/nfs + ${config.system.sbin.modprobe}/sbin/modprobe nfsd || true + ${pkgs.sysvtools}/bin/mountpoint -q /proc/fs/nfsd \ + || ${config.system.sbin.mount}/bin/mount -t nfsd none /proc/fs/nfsd + ${optionalString cfg.server.createMountPoints '' # create export directories: # skip comments, take first col which may either be a quoted # "foo bar" or just foo (-> man export) - sed '/^#.*/d;s/^"\([^"]*\)".*/\1/;t;s/[ ].*//' ${cfg.server.exports} \ + sed '/^#.*/d;s/^"\([^"]*\)".*/\1/;t;s/[ ].*//' ${exports} \ | xargs -d '\n' mkdir -p '' } - # exports file is ${cfg.server.exports} + # exports file is ${exports} # keep this comment so that this job is restarted whenever exports changes! exportfs -ra ''; @@ -128,7 +134,9 @@ startOn = "started nfs-kernel-exports and started portmap"; stopOn = "stopping nfs-kernel-exports"; - exec = "${pkgs.nfsUtils}/sbin/rpc.nfsd ${if cfg.server.hostName != null then "-H ${cfg.server.hostName}" else ""} ${builtins.toString cfg.server.nproc}"; + preStart = "${pkgs.nfsUtils}/sbin/rpc.nfsd ${if cfg.server.hostName != null then "-H ${cfg.server.hostName}" else ""} ${builtins.toString cfg.server.nproc}"; + + postStop = "${pkgs.nfsUtils}/sbin/rpc.nfsd 0"; }; } Modified: nixos/branches/boot-order/modules/tasks/filesystems.nix =================================================================== --- nixos/branches/boot-order/modules/tasks/filesystems.nix 2010-06-08 13:38:28 UTC (rev 22186) +++ nixos/branches/boot-order/modules/tasks/filesystems.nix 2010-06-08 16:01:31 UTC (rev 22187) @@ -142,7 +142,7 @@ + " " + fs.fsType + " " + fs.options + " 0" - + " " + (if fs.mountPoint == "/" then "1" else "2") + + " " + (if fs.fsType == "none" then "0" else if fs.mountPoint == "/" then "1" else "2") + "\n" )} @@ -187,8 +187,6 @@ task = true; - stopOn = "filesystem"; - extraConfig = "console owner"; script = _______________________________________________ nix-commits mailing list [email protected] http://mail.cs.uu.nl/mailman/listinfo/nix-commits
