mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-02 17:09:09 +03:00
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.nfs.client.enable = true; # needed for statd
|
||||
services.nfs.client.enable = true; # needed for statd and idmapd
|
||||
|
||||
environment.systemPackages = [ pkgs.nfsUtils ];
|
||||
|
||||
@ -105,6 +105,7 @@ in
|
||||
postStart =
|
||||
''
|
||||
ensure statd
|
||||
ensure idmapd
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -187,6 +187,7 @@ in
|
||||
|
||||
${optionalString config.services.nfs.client.enable ''
|
||||
ensure statd || true
|
||||
ensure idmapd || true
|
||||
''}
|
||||
|
||||
echo "mounting filesystems..."
|
||||
|
@ -6,6 +6,27 @@ let
|
||||
|
||||
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
|
||||
|
||||
{
|
||||
@ -40,6 +61,8 @@ in
|
||||
cp -v ${pkgs.klibc}/lib/klibc/bin.static/nfsmount $out/bin
|
||||
'';
|
||||
|
||||
environment.etc = singleton idmapdConfFile;
|
||||
|
||||
jobs.statd =
|
||||
{ description = "Kernel NFS server - Network Status Monitor";
|
||||
|
||||
@ -50,9 +73,8 @@ in
|
||||
preStart =
|
||||
''
|
||||
ensure portmap
|
||||
mkdir -p /var/lib/nfs
|
||||
mkdir -p /var/lib/nfs/sm
|
||||
mkdir -p /var/lib/nfs/sm.bak
|
||||
mkdir -p ${nfsStateDir}/sm
|
||||
mkdir -p ${nfsStateDir}/sm.bak
|
||||
sm-notify -d
|
||||
'';
|
||||
|
||||
@ -61,5 +83,29 @@ in
|
||||
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…
Reference in New Issue
Block a user