* 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.

svn path=/nixos/branches/boot-order/; revision=22196
This commit is contained in:
Eelco Dolstra 2010-06-09 13:18:01 +00:00
parent 156ba2def2
commit 645ed8d3b4

View file

@ -146,8 +146,8 @@ in
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,15 +159,32 @@ in
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";
};
};