Remove the portmap module

It's obsoleted by rpcbind.
This commit is contained in:
Eelco Dolstra 2013-09-26 17:04:07 +02:00
parent f70fbb1791
commit b7b2476499
6 changed files with 2 additions and 125 deletions

View File

@ -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;

View File

@ -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

View File

@ -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
'';
};
};
}

View File

@ -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";
};
});
};
}

View File

@ -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);

View File

@ -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");
'';
}