Remove the portmap module
It's obsoleted by rpcbind.
This commit is contained in:
parent
f70fbb1791
commit
b7b2476499
|
@ -35,7 +35,6 @@
|
||||||
ftp = 8;
|
ftp = 8;
|
||||||
bitlbee = 9;
|
bitlbee = 9;
|
||||||
avahi = 10;
|
avahi = 10;
|
||||||
portmap = 11;
|
|
||||||
atd = 12;
|
atd = 12;
|
||||||
zabbix = 13;
|
zabbix = 13;
|
||||||
postfix = 14;
|
postfix = 14;
|
||||||
|
@ -120,7 +119,6 @@
|
||||||
ftp = 8;
|
ftp = 8;
|
||||||
bitlbee = 9;
|
bitlbee = 9;
|
||||||
avahi = 10;
|
avahi = 10;
|
||||||
portmap = 11;
|
|
||||||
atd = 12;
|
atd = 12;
|
||||||
postfix = 13;
|
postfix = 13;
|
||||||
postdrop = 14;
|
postdrop = 14;
|
||||||
|
|
|
@ -168,7 +168,6 @@
|
||||||
./services/networking/oidentd.nix
|
./services/networking/oidentd.nix
|
||||||
./services/networking/openfire.nix
|
./services/networking/openfire.nix
|
||||||
./services/networking/openvpn.nix
|
./services/networking/openvpn.nix
|
||||||
./services/networking/portmap.nix
|
|
||||||
./services/networking/prayer.nix
|
./services/networking/prayer.nix
|
||||||
./services/networking/privoxy.nix
|
./services/networking/privoxy.nix
|
||||||
./services/networking/quassel.nix
|
./services/networking/quassel.nix
|
||||||
|
|
|
@ -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
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
|
@ -29,9 +29,6 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
check = mkAssert (!(config.services.rpcbind.enable && config.services.portmap.enable))
|
|
||||||
"Portmap and rpcbind cannot both be enabled.";
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -59,7 +56,7 @@ in
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf config.services.rpcbind.enable (check {
|
config = mkIf config.services.rpcbind.enable {
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.rpcbind ];
|
environment.systemPackages = [ pkgs.rpcbind ];
|
||||||
|
|
||||||
|
@ -79,6 +76,6 @@ in
|
||||||
serviceConfig.ExecStart = "@${pkgs.rpcbind}/bin/rpcbind rpcbind";
|
serviceConfig.ExecStart = "@${pkgs.rpcbind}/bin/rpcbind rpcbind";
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,6 @@ with import ../lib/testing.nix { inherit system minimal; };
|
||||||
#nfs4 = makeTest (import ./nfs.nix { version = 4; });
|
#nfs4 = makeTest (import ./nfs.nix { version = 4; });
|
||||||
openssh = makeTest (import ./openssh.nix);
|
openssh = makeTest (import ./openssh.nix);
|
||||||
partition = makeTest (import ./partition.nix);
|
partition = makeTest (import ./partition.nix);
|
||||||
portmap = makeTest (import ./portmap.nix);
|
|
||||||
proxy = makeTest (import ./proxy.nix);
|
proxy = makeTest (import ./proxy.nix);
|
||||||
quake3 = makeTest (import ./quake3.nix);
|
quake3 = makeTest (import ./quake3.nix);
|
||||||
simple = makeTest (import ./simple.nix);
|
simple = makeTest (import ./simple.nix);
|
||||||
|
|
|
@ -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");
|
|
||||||
'';
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in a new issue