summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-09-26 17:04:07 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-09-26 17:04:07 +0200
commitb7b2476499fac4ccc63057adfa484df6184ea18d (patch)
treefbb64312fb429dc83412e8f890ac43f870cc5e2a
parentf70fbb179128e795fcc6d07c52454c1dbcaa196a (diff)
downloadnixlib-b7b2476499fac4ccc63057adfa484df6184ea18d.tar
nixlib-b7b2476499fac4ccc63057adfa484df6184ea18d.tar.gz
nixlib-b7b2476499fac4ccc63057adfa484df6184ea18d.tar.bz2
nixlib-b7b2476499fac4ccc63057adfa484df6184ea18d.tar.lz
nixlib-b7b2476499fac4ccc63057adfa484df6184ea18d.tar.xz
nixlib-b7b2476499fac4ccc63057adfa484df6184ea18d.tar.zst
nixlib-b7b2476499fac4ccc63057adfa484df6184ea18d.zip
Remove the portmap module
It's obsoleted by rpcbind.
-rw-r--r--modules/misc/ids.nix2
-rw-r--r--modules/module-list.nix1
-rw-r--r--modules/services/networking/portmap.nix99
-rw-r--r--modules/services/networking/rpcbind.nix7
-rw-r--r--tests/default.nix1
-rw-r--r--tests/portmap.nix17
6 files changed, 2 insertions, 125 deletions
diff --git a/modules/misc/ids.nix b/modules/misc/ids.nix
index 315d3e9cd236..d8ca11158dca 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 9f1563c0768d..a27febb7bc13 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 474491a4c4b1..000000000000
--- 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 7180b2cfa14f..00c958c5a4a2 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 36a2a2d608b8..bd1aa45fe281 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 0d2bf1536853..000000000000
--- 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");
-    '';
-
-}