Author: eelco
Date: Fri Mar 16 19:49:47 2012
New Revision: 33171
URL: https://nixos.org/websvn/nix/?rev=33171&sc=1

Log:
* portmap: add a postStart action that ensures that portmap is
  actually listening.  Otherwise we have a race condition during boot
  where statd's start can be delayed, causing NFSv3 mounting to fail.

Modified:
   nixos/trunk/modules/services/networking/portmap.nix

Modified: nixos/trunk/modules/services/networking/portmap.nix
==============================================================================
--- nixos/trunk/modules/services/networking/portmap.nix Fri Mar 16 19:40:36 
2012        (r33170)
+++ nixos/trunk/modules/services/networking/portmap.nix Fri Mar 16 19:49:47 
2012        (r33171)
@@ -73,13 +73,22 @@
 
         daemonType = "fork";
 
+        path = [ portmap pkgs.netcat ];
+
         exec =
           ''
-            ${portmap}/sbin/portmap \
+            portmap \
               ${optionalString (config.services.portmap.chroot != "")
                 "-t '${config.services.portmap.chroot}'"} \
               ${if config.services.portmap.verbose then "-v" else ""}
           '';
+
+        postStart =
+          ''
+            # Portmap forks into the background before it starts
+            # listening, so wait until its ready.
+            while ! nc -z localhost 111; do sleep 1; done
+          '';
       };
 
   };
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to