You are not logged in.

#1 2017-05-22 11:39:20

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 189

How I can disable NFSv4?

I have installed NFS to share one folder with a multimedia player but it only needs NFSv3. I want to disable NFSv4 but I can't.
I have modified /etc/nfs.conf with:

....
[nfsd]
# debug=0
# threads=8
# host=
# port=0
# grace-time=90
# lease-time=90
# udp=y
# tcp=y
vers2=y
vers3=y
vers4=n
#vers4.0=n
#vers4.1=n
#vers4.2=n
....

But systemd stills try to start several NFSv4 services:

...
may 22 13:32:43 arch-juan systemd[1]: Starting NFSv4 ID-name mapping service...
may 22 13:32:43 arch-juan rpc.idmapd[430]: rpc.idmapd: Skipping configuration file "/etc/idmapd.conf": No such file or directory
may 22 13:32:43 arch-juan rpc.idmapd[434]: Unable to open '/proc/sys/fs/nfs/idmap_cache_timeout' to set client cache expiration time to 0 seconds
....

How I can disable NFSv4 completely?

Offline

#2 2017-05-22 12:03:20

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: How I can disable NFSv4?

Well,

[tom@localhost ~]$ grep idmapd /usr/lib/systemd/system/nfs-server.service 
Wants=rpc-statd.service nfs-idmapd.service
After= nfs-idmapd.service rpc-statd.service

Shouldn't matter if nfs-idmapd.service simply fails though, because it's a Wants. Though you can override it by some means anyway, like:

# systemctl edit --full nfs-server

Last edited by tom.ty89 (2017-05-22 12:06:50)

Offline

#3 2017-05-22 13:27:54

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 189

Re: How I can disable NFSv4?

Then NFS v3 doesn't need rpc-statd.service nor nfs-idmapd.service?

Offline

#4 2017-05-22 13:30:33

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: How I can disable NFSv4?

I have no idea. Wasn't it you who said that idmapd is an NFSv4 service? Neither was I suggesting you to remove rpc-statd.service from the Wants line or the After line, nor to remove nfs-idmapd.service from the After line.

Last edited by tom.ty89 (2017-05-22 13:31:13)

Offline

#5 2017-05-22 13:42:33

j1simon
Member
From: Denmark
Registered: 2016-01-28
Posts: 189

Re: How I can disable NFSv4?

ok, I've tested it and this service file is valid for NFSv2-3:

$ cat /etc/systemd/system/nfs-server.service                        
[Unit]
Description=NFS server and services
DefaultDependencies=no
Requires= network.target proc-fs-nfsd.mount
Requires= nfs-mountd.service
Wants=rpcbind.socket
#Wants=rpc-statd.service nfs-idmapd.service
#Wants=rpc-statd-notify.service

After= local-fs.target
After= network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
#After= nfs-idmapd.service rpc-statd.service
#Before= rpc-statd-notify.service

# GSS services dependencies and ordering
#Wants=auth-rpcgss-module.service
#After=rpc-gssd.service gssproxy.service rpc-svcgssd.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/sbin/exportfs -r
ExecStart=/usr/sbin/rpc.nfsd
ExecStop=/usr/sbin/rpc.nfsd 0
ExecStopPost=/usr/sbin/exportfs -au
ExecStopPost=/usr/sbin/exportfs -f

ExecReload=/usr/sbin/exportfs -r

[Install]
WantedBy=multi-user.target

I've opened a bug in Arch about this package: https://bugs.archlinux.org/task/54156

Offline

#6 2017-05-22 13:50:00

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: How I can disable NFSv4?

You shouldn't have. The service files are shipped are provided by upstream: https://git.archlinux.org/svntogit/pack … /nfs-utils

It's also a common case that the systemd units in shipped in software packages suck. I would even say many upstream devs don't really know (or simply don't care) how to use systemd properly. So really, just treat them as example, and adapt it in whatever way suits you.

Not to mention that if nfs-idmapd.service simply fails quickly in your case, the shipped nfs-server.service can be considered valid because it needs to be general enough to cover NFSv4 as well, while because it's a Wants but not a Requires, the failure of nfs-idmapd.service does not prevent nfs-server.service from starting.

Last edited by tom.ty89 (2017-05-22 13:51:22)

Offline

#7 2017-05-22 13:55:28

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: How I can disable NFSv4?

Btw, maybe

# systemctl mask nfs-idmapd.service

helps as well.

Offline

Board footer

Powered by FluxBB