Adding idmapd, for NFSv4.
Patch by Rickard Nilsson. This may fix rpc.statd start. svn path=/nixos/trunk/; revision=33330
This commit is contained in:
parent
7a9a33e90d
commit
20edb255bd
@ -69,7 +69,7 @@ in
|
|||||||
|
|
||||||
services.portmap.enable = true;
|
services.portmap.enable = true;
|
||||||
|
|
||||||
services.nfs.client.enable = true; # needed for statd
|
services.nfs.client.enable = true; # needed for statd and idmapd
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.nfsUtils ];
|
environment.systemPackages = [ pkgs.nfsUtils ];
|
||||||
|
|
||||||
@ -105,6 +105,7 @@ in
|
|||||||
postStart =
|
postStart =
|
||||||
''
|
''
|
||||||
ensure statd
|
ensure statd
|
||||||
|
ensure idmapd
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -187,6 +187,7 @@ in
|
|||||||
|
|
||||||
${optionalString config.services.nfs.client.enable ''
|
${optionalString config.services.nfs.client.enable ''
|
||||||
ensure statd || true
|
ensure statd || true
|
||||||
|
ensure idmapd || true
|
||||||
''}
|
''}
|
||||||
|
|
||||||
echo "mounting filesystems..."
|
echo "mounting filesystems..."
|
||||||
|
@ -6,6 +6,27 @@ let
|
|||||||
|
|
||||||
inInitrd = any (fs: fs == "nfs") config.boot.initrd.supportedFilesystems;
|
inInitrd = any (fs: fs == "nfs") config.boot.initrd.supportedFilesystems;
|
||||||
|
|
||||||
|
nfsStateDir = "/var/lib/nfs";
|
||||||
|
|
||||||
|
rpcMountpoint = "${nfsStateDir}/rpc_pipefs";
|
||||||
|
|
||||||
|
idmapdConfFile = {
|
||||||
|
target = "idmapd.conf";
|
||||||
|
source = pkgs.writeText "idmapd.conf" ''
|
||||||
|
[General]
|
||||||
|
Pipefs-Directory = ${rpcMountpoint}
|
||||||
|
${optionalString (config.networking.domain != "")
|
||||||
|
"Domain = ${config.networking.domain}"}
|
||||||
|
|
||||||
|
[Mapping]
|
||||||
|
Nobody-User = nobody
|
||||||
|
Nobody-Group = nogroup
|
||||||
|
|
||||||
|
[Translation]
|
||||||
|
Method = nsswitch
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -40,6 +61,8 @@ in
|
|||||||
cp -v ${pkgs.klibc}/lib/klibc/bin.static/nfsmount $out/bin
|
cp -v ${pkgs.klibc}/lib/klibc/bin.static/nfsmount $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
environment.etc = singleton idmapdConfFile;
|
||||||
|
|
||||||
jobs.statd =
|
jobs.statd =
|
||||||
{ description = "Kernel NFS server - Network Status Monitor";
|
{ description = "Kernel NFS server - Network Status Monitor";
|
||||||
|
|
||||||
@ -50,9 +73,8 @@ in
|
|||||||
preStart =
|
preStart =
|
||||||
''
|
''
|
||||||
ensure portmap
|
ensure portmap
|
||||||
mkdir -p /var/lib/nfs
|
mkdir -p ${nfsStateDir}/sm
|
||||||
mkdir -p /var/lib/nfs/sm
|
mkdir -p ${nfsStateDir}/sm.bak
|
||||||
mkdir -p /var/lib/nfs/sm.bak
|
|
||||||
sm-notify -d
|
sm-notify -d
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -61,5 +83,29 @@ in
|
|||||||
exec = "rpc.statd --no-notify";
|
exec = "rpc.statd --no-notify";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
jobs.idmapd =
|
||||||
|
{ description = "Kernel NFS server - ID Map Daemon";
|
||||||
|
|
||||||
|
path = [ pkgs.nfsUtils pkgs.sysvtools pkgs.utillinux ];
|
||||||
|
|
||||||
|
stopOn = "starting shutdown";
|
||||||
|
|
||||||
|
preStart =
|
||||||
|
''
|
||||||
|
ensure portmap
|
||||||
|
mkdir -p ${rpcMountpoint}
|
||||||
|
mount -t rpc_pipefs rpc_pipefs ${rpcMountpoint}
|
||||||
|
'';
|
||||||
|
|
||||||
|
postStop =
|
||||||
|
''
|
||||||
|
umount ${rpcMountpoint}
|
||||||
|
'';
|
||||||
|
|
||||||
|
daemonType = "fork";
|
||||||
|
|
||||||
|
exec = "rpc.idmapd";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user