diff --git a/modules/services/networking/portmap.nix b/modules/services/networking/portmap.nix index 142e057c7de..3d887b7729d 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 + ''; }; };