Author: eelco
Date: 2010-07-07 12:11:29 +0000 (Wed, 07 Jul 2010)
New Revision: 22508

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22508&view=rev

Modified:
   nixos/trunk/modules/services/network-filesystems/nfs-kernel.nix
   nixos/trunk/modules/tasks/filesystems.nix

Log:
* Merge the ?\226?\128?\152nfs-kernel-sm-notify?\226?\128?\153 task into the 
post-start script of
  the ?\226?\128?\152nfs-kernel-statd?\226?\128?\153 task.
* Work around an apparent bug in Upstart: the 
?\226?\128?\152mountall?\226?\128?\153 task cannot
  be restarted because of the ?\226?\128?\152starting mountall?\226?\128?\153 
condition in the
  statd task.  So instead make ?\226?\128?\152mountall?\226?\128?\153 depend on 
?\226?\128?\152started
  nfs-kernel-statd?\226?\128?\153.


Changes:

Modified: nixos/trunk/modules/services/network-filesystems/nfs-kernel.nix
===================================================================
--- nixos/trunk/modules/services/network-filesystems/nfs-kernel.nix     
2010-07-07 11:44:58 UTC (rev 22507)
+++ nixos/trunk/modules/services/network-filesystems/nfs-kernel.nix     
2010-07-07 12:11:29 UTC (rev 22508)
@@ -161,7 +161,7 @@
 
             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 @@
             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";
           };
         };
       

Modified: nixos/trunk/modules/tasks/filesystems.nix
===================================================================
--- nixos/trunk/modules/tasks/filesystems.nix   2010-07-07 11:44:58 UTC (rev 
22507)
+++ nixos/trunk/modules/tasks/filesystems.nix   2010-07-07 12:11:29 UTC (rev 
22508)
@@ -155,7 +155,13 @@
       };
 
     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;
         

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to