* Merge the ‘nfs-kernel-sm-notify’ task into the post-start script of

the ‘nfs-kernel-statd’ task.
* Work around an apparent bug in Upstart: the ‘mountall’ task cannot
  be restarted because of the ‘starting mountall’ condition in the
  statd task.  So instead make ‘mountall’ depend on ‘started
  nfs-kernel-statd’.

svn path=/nixos/trunk/; revision=22508
This commit is contained in:
Eelco Dolstra 2010-07-07 12:11:29 +00:00
parent d0342b4cf5
commit 9ac60a3aa3
2 changed files with 10 additions and 16 deletions

View file

@ -161,7 +161,7 @@ in
description = "Kernel NFS server - Network Status Monitor";
startOn = "${if cfg.server.enable then "starting nfs-kernel-nfsd and " else ""} started portmap";
startOn = "started portmap" + optionalString cfg.server.enable " and starting nfs-kernel-nfsd";
stopOn = "never";
preStart =
@ -174,21 +174,9 @@ in
daemonType = "fork";
exec = "${pkgs.nfsUtils}/sbin/rpc.statd --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";
postStart = optionalString cfg.client.enable
"${pkgs.nfsUtils}/sbin/sm-notify -d";
};
};

View file

@ -155,7 +155,13 @@ in
};
jobs.mountall =
{ startOn = "started udev";
{ startOn = "started udev"
# !!! The `started nfs-kernel-statd' condition shouldn't be
# here. The `nfs-kernel-statd' job should have a `starting
# mountall' condition. However, that doesn't work if
# `mountall' is restarted due to an apparent bug in Upstart:
# `mountall' hangs forever in the `start/starting' state.
+ optionalString config.services.nfsKernel.client.enable " and started nfs-kernel-statd";
task = true;