From 823471a1001e29beac388283e4206d25d480d2ac Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 16 Mar 2012 19:49:47 +0000 Subject: [PATCH] * 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. svn path=/nixos/trunk/; revision=33171 --- modules/services/networking/portmap.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/services/networking/portmap.nix b/modules/services/networking/portmap.nix index 142e057c7def..3d887b7729de 100644 --- a/modules/services/networking/portmap.nix +++ b/modules/services/networking/portmap.nix @@ -73,13 +73,22 @@ in 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 + ''; }; };