Author: eelco Date: 2010-06-09 13:18:01 +0000 (Wed, 09 Jun 2010) New Revision: 22196
You can view the changes in this commit at: https://svn.nixos.org/viewvc/nix?rev=22196&view=rev Modified: nixos/branches/boot-order/modules/services/network-filesystems/nfs-kernel.nix Log: * Start NFS daemons in the right order as described in the nfs-utils README (i.e. for the server: exportfs, mountd, statd, nfsd, sm-notify; for the client: statd / sm-notify before mountall). This is important to allow locking to work correctly. 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-09 13:15:15 UTC (rev 22195) +++ nixos/branches/boot-order/modules/services/network-filesystems/nfs-kernel.nix 2010-06-09 13:18:01 UTC (rev 22196) @@ -146,8 +146,8 @@ description = "Kernel NFS server - mount daemon"; - startOn = "started nfs-kernel-nfsd and started portmap"; - stopOn = "stopping nfs-kernel-exports"; + startOn = "starting nfs-kernel-nfsd and started portmap"; + stopOn = "stopped nfs-kernel-nfsd"; exec = "${pkgs.nfsUtils}/sbin/rpc.mountd -F -f /etc/exports"; }; @@ -159,16 +159,33 @@ description = "Kernel NFS server - Network Status Monitor"; - startOn = "${if cfg.server.enable then "started nfs-kernel-nfsd and " else ""} started portmap"; - stopOn = "stopping nfs-kernel-exports"; + startOn = "${if cfg.server.enable then "starting nfs-kernel-nfsd and " else ""} started portmap"; + stopOn = if cfg.server.enable then "stopped nfs-kernel-nfsd" else "starting shutdown"; preStart = '' mkdir -p /var/lib/nfs + mkdir -p /var/lib/nfs/sm + mkdir -p /var/lib/nfs/sm.bak ''; - exec = "${pkgs.nfsUtils}/sbin/rpc.statd -F"; + exec = "${pkgs.nfsUtils}/sbin/rpc.statd --foreground --no-notify"; }; + } + + // optionalAttrs (cfg.client.enable || cfg.server.enable) + { nfs_kernel_sm_notify = + { name = "nfs-kernel-sm-notify"; + + description = "Kernel NFS server - Reboot notification"; + + startOn = "started nfs-kernel-statd" + + (if cfg.client.enable then " and starting mountall" else ""); + + task = true; + + exec = "${pkgs.nfsUtils}/sbin/sm-notify -d"; + }; }; }; _______________________________________________ nix-commits mailing list [email protected] http://mail.cs.uu.nl/mailman/listinfo/nix-commits
