From b7b2476499fac4ccc63057adfa484df6184ea18d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 26 Sep 2013 17:04:07 +0200 Subject: [PATCH] Remove the portmap module It's obsoleted by rpcbind. --- modules/misc/ids.nix | 2 - modules/module-list.nix | 1 - modules/services/networking/portmap.nix | 99 ------------------------- modules/services/networking/rpcbind.nix | 7 +- tests/default.nix | 1 - tests/portmap.nix | 17 ----- 6 files changed, 2 insertions(+), 125 deletions(-) delete mode 100644 modules/services/networking/portmap.nix delete mode 100644 tests/portmap.nix diff --git a/modules/misc/ids.nix b/modules/misc/ids.nix index 315d3e9cd23..d8ca11158dc 100644 --- a/modules/misc/ids.nix +++ b/modules/misc/ids.nix @@ -35,7 +35,6 @@ ftp = 8; bitlbee = 9; avahi = 10; - portmap = 11; atd = 12; zabbix = 13; postfix = 14; @@ -120,7 +119,6 @@ ftp = 8; bitlbee = 9; avahi = 10; - portmap = 11; atd = 12; postfix = 13; postdrop = 14; diff --git a/modules/module-list.nix b/modules/module-list.nix index 9f1563c0768..a27febb7bc1 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -168,7 +168,6 @@ ./services/networking/oidentd.nix ./services/networking/openfire.nix ./services/networking/openvpn.nix - ./services/networking/portmap.nix ./services/networking/prayer.nix ./services/networking/privoxy.nix ./services/networking/quassel.nix diff --git a/modules/services/networking/portmap.nix b/modules/services/networking/portmap.nix deleted file mode 100644 index 474491a4c4b..00000000000 --- a/modules/services/networking/portmap.nix +++ /dev/null @@ -1,99 +0,0 @@ -{ config, pkgs, ... }: - -with pkgs.lib; - -let - - uid = config.ids.uids.portmap; - gid = config.ids.gids.portmap; - - portmap = pkgs.portmap.override { daemonUID = uid; daemonGID = gid; }; - -in - -{ - - ###### interface - - options = { - - services.portmap = { - - enable = mkOption { - default = false; - description = '' - Whether to enable `portmap', an ONC RPC directory service - notably used by NFS and NIS, and which can be queried - using the rpcinfo(1) command. - ''; - }; - - verbose = mkOption { - default = false; - description = '' - Whether to enable verbose output. - ''; - }; - - chroot = mkOption { - default = "/var/empty"; - description = '' - If non-empty, a path to change root to. - ''; - }; - - }; - - }; - - - ###### implementation - - config = mkIf config.services.portmap.enable { - - environment.systemPackages = [ portmap ]; - - users.extraUsers = singleton - { name = "portmap"; - inherit uid; - description = "Portmap daemon user"; - home = "/var/empty"; - }; - - users.extraGroups = singleton - { name = "portmap"; - inherit gid; - }; - - jobs.portmap = - { description = "ONC RPC portmap"; - - startOn = "started network-interfaces"; - stopOn = ""; # needed during shutdown - - daemonType = "fork"; - - path = [ portmap pkgs.netcat ]; - - exec = - '' - 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 - stop_check - sleep 1 - done - ''; - }; - - }; - -} diff --git a/modules/services/networking/rpcbind.nix b/modules/services/networking/rpcbind.nix index 7180b2cfa14..00c958c5a4a 100644 --- a/modules/services/networking/rpcbind.nix +++ b/modules/services/networking/rpcbind.nix @@ -29,9 +29,6 @@ let ''; }; - check = mkAssert (!(config.services.rpcbind.enable && config.services.portmap.enable)) - "Portmap and rpcbind cannot both be enabled."; - in { @@ -59,7 +56,7 @@ in ###### implementation - config = mkIf config.services.rpcbind.enable (check { + config = mkIf config.services.rpcbind.enable { environment.systemPackages = [ pkgs.rpcbind ]; @@ -79,6 +76,6 @@ in serviceConfig.ExecStart = "@${pkgs.rpcbind}/bin/rpcbind rpcbind"; }; - }); + }; } diff --git a/tests/default.nix b/tests/default.nix index 36a2a2d608b..bd1aa45fe28 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -22,7 +22,6 @@ with import ../lib/testing.nix { inherit system minimal; }; #nfs4 = makeTest (import ./nfs.nix { version = 4; }); openssh = makeTest (import ./openssh.nix); partition = makeTest (import ./partition.nix); - portmap = makeTest (import ./portmap.nix); proxy = makeTest (import ./proxy.nix); quake3 = makeTest (import ./quake3.nix); simple = makeTest (import ./simple.nix); diff --git a/tests/portmap.nix b/tests/portmap.nix deleted file mode 100644 index 0d2bf153685..00000000000 --- a/tests/portmap.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, ... }: - -{ - - machine = - { config, pkgs, ... }: - - { services.portmap.enable = true; }; - - testScript = - '' - # The `portmap' service must be registered once for TCP and once for - # UDP. - $machine->succeed("test `rpcinfo -p | grep portmapper | wc -l` -eq 2"); - ''; - -}