* 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"; 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"; stopOn = "never";
preStart = preStart =
@ -174,21 +174,9 @@ in
daemonType = "fork"; daemonType = "fork";
exec = "${pkgs.nfsUtils}/sbin/rpc.statd --no-notify"; exec = "${pkgs.nfsUtils}/sbin/rpc.statd --no-notify";
};
}
// optionalAttrs (cfg.client.enable || cfg.server.enable) postStart = optionalString cfg.client.enable
{ nfs_kernel_sm_notify = "${pkgs.nfsUtils}/sbin/sm-notify -d";
{ 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";
}; };
}; };

View File

@ -155,7 +155,13 @@ in
}; };
jobs.mountall = 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; task = true;