RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1264387 - change to use lockd.conf instead of sysconfig to set module lockd parameters
Summary: change to use lockd.conf instead of sysconfig to set module lockd parameters
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: Yongcheng Yang
URL:
Whiteboard:
: 1247089 (view as bug list)
Depends On:
Blocks: 1355652
TreeView+ depends on / blocked
 
Reported: 2015-09-18 10:40 UTC by Yongcheng Yang
Modified: 2020-01-17 15:33 UTC (History)
5 users (show)

Fixed In Version: nfs-utils-1.3.0-0.28.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 05:00:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1300175 0 unspecified CLOSED document the ports used by NFS services 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1394720 0 high CLOSED Local ISO domain is inaccessible on el7.3 2021-04-15 12:09:03 UTC
Red Hat Bugzilla 1413272 0 unspecified CLOSED nlockmgr no longer reading /etc/sysconfig/nfs file for LOCKD_TCPPORT and LOCKD_UDPPORT values 2021-12-10 14:52:20 UTC
Red Hat Knowledge Base (Solution) 3404671 0 None None None 2018-04-09 16:25:12 UTC
Red Hat Product Errata RHBA-2016:2383 0 normal SHIPPED_LIVE nfs-utils bug fix and enhancement update 2016-11-03 13:53:02 UTC

Internal Links: 1300175 1394720 1413272

Description Yongcheng Yang 2015-09-18 10:40:56 UTC
Description of problem:
Change the value of LOCKDARG in /etc/sysconfig/nfs and then restart nfs-config.service. It seems that the arguments setting of LOCKDARG doesn't take effect.
Even rebooting the machine cannot change the lockd setting neither. Maybe during the booting it has load it by a default setting.
The lockd is a kernel module, we can only change it by unload and reload the lockd module. But how can we define the arguments?

So is LOCKDARG in /etc/sysconfig/nfs useless, or the method to load it is with some problem?
Seems the following code of /usr/lib/systemd/scripts/nfs-utils_env.sh seems never works:
[root@hp-dl380pg8-01 ~]# cat /usr/lib/systemd/scripts/nfs-utils_env.sh 
...
[ -n "$LOCKDARG" ] && /sbin/modprobe lockd $LOCKDARG
if [ -n "$LOCKD_TCPPORT" -o -n "$LOCKD_UDPPORT" ]; then
	[ -z "$LOCKDARG" ] && /sbin/modprobe lockd $LOCKDARG
	<snip>
fi
...

Version-Release number of selected component (if applicable):
nfs-utils-1.3.0-0.20.el7

How reproducible:
100%

Steps to Reproduce:
1. echo LOCKDARG="nsm_use_hostnames=1" > /etc/sysconfig/nfs
2. service nfs-config restart or just reboot
3. sysctl fs.nfs.nsm_use_hostnames
or "cat /sys/module/lockd/parameters/nsm_use_hostnames"

Actual results:
[root@hp-dl380pg8-01 ~]# grep '.*' -r /sys/module/lockd/parameters/
/sys/module/lockd/parameters/nlm_grace_period:0
/sys/module/lockd/parameters/nlm_tcpport:48888
/sys/module/lockd/parameters/nlm_max_connections:1111 <<<<<<<<<<<<<<<<
/sys/module/lockd/parameters/nlm_timeout:10
/sys/module/lockd/parameters/nsm_use_hostnames:N <<<<<<<<<<<<<<<<<<<<<
/sys/module/lockd/parameters/nlm_udpport:46666
[root@hp-dl380pg8-01 ~]# vi /etc/sysconfig/nfs
[root@hp-dl380pg8-01 ~]# cat /etc/sysconfig/nfs
# Optional arguments passed to in-kernel lockd
LOCKDARG="nsm_use_hostnames=1 nlm_max_connections=1234"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Cannot take effect
LOCKD_TCPPORT=23456
LOCKD_UDPPORT=65432
[root@hp-dl380pg8-01 ~]# service nfs-config restart
Redirecting to /bin/systemctl restart  nfs-config.service
[root@hp-dl380pg8-01 ~]# grep '.*' -r /sys/module/lockd/parameters/
/sys/module/lockd/parameters/nlm_grace_period:0
/sys/module/lockd/parameters/nlm_tcpport:23456
/sys/module/lockd/parameters/nlm_max_connections:1111 <<<<<<<<<<<<<<<
/sys/module/lockd/parameters/nlm_timeout:10
/sys/module/lockd/parameters/nsm_use_hostnames:N <<<<<<<<<<<<<<<<<<<<
/sys/module/lockd/parameters/nlm_udpport:65432
[root@hp-dl380pg8-01 ~]# 

Expected results:
Use "LOCKDARG" to define lockd arguments

Additional info:
The LOCKD_TCPPORT/LOCKD_UDPPORT in /etc/sysconfig/nfs can work

Comment 4 Steve Dickson 2015-09-30 11:26:32 UTC
I think this because proc-fs-nfsd.mount actually loading 
the lockd module and that service does not look at
the variables in /etc/sysconfig/nfs... 

Since there are other ways to set module parameters, let
look into this in 7.3

Comment 11 Steve Dickson 2016-05-16 14:43:52 UTC
With this commit the following sysconfig/nfs lockd interface 
# Optional arguments passed to in-kernel lockd
LOCKDARG="nsm_use_hostnames=1"
# TCP port rpc.lockd should listen on.
#LOCKD_TCPPORT=32803
# UDP port rpc.lockd should listen on.
#LOCKD_UDPPORT=32769
#

No longer exists, since they never worked. This interface
has been replaced by the /etc/modprobe.d/lock.conf interface
#
# Set the NFS lock manager grace period. n is measured in seconds. 
#options lockd nlm_grace_period=90
#
# Set the TCP port that the NFS lock manager should use. 
# port must be a valid TCP port value (1-65535).
#options lockd nlm_tcpport
#
# Set the UDP port that the NFS lock manager should use.
# port must be a valid UDP port value (1-65535).
#options lockd nlm_udpport
#
# Set the maximum number of outstanding connections 
#options lockd nlm_max_connections=1024
#
# Set the default time value for the NFS lock manager
# in seconds. Default is 10 secs
#options lockd nlm_timeout=10
#
# Choose whether to record the caller_name or IP address
# this peer in the local rpc.statd's database.
#options lockd nsm_use_hostnames=0


If the old lockd interface was document (which I could not find)
then it has to change to reflex new interface.

Comment 15 Yongcheng Yang 2016-05-27 09:42:14 UTC
Move to VERIFIED according to comment 14 and continue to run the automatic case.

Comment 16 Yongcheng Yang 2016-06-02 07:08:14 UTC
Seems cannot set the parameter "nlm_timeout" bigger than 20 While testing the new lockd.conf, and i still not find any explanation in man page or usage.

Hi Steve, does this action all right? And do we need to add some description about this limitation?

[root@hp-dl385pg8-08 ~]# echo "options lockd nlm_timeout=21" >/etc/modprobe.d/lockd.conf
[root@hp-dl385pg8-08 ~]# systemctl stop  nfs.service
[root@hp-dl385pg8-08 ~]# systemctl stop  rpc-gssd.service
[root@hp-dl385pg8-08 ~]# umount /proc/fs/nfsd
[root@hp-dl385pg8-08 ~]# modprobe -r nfsd
[root@hp-dl385pg8-08 ~]# modprobe -r lockd
modprobe: FATAL: Module lockd is in use.
[root@hp-dl385pg8-08 ~]# modprobe -r nfs
modprobe: FATAL: Module nfs is in use.
[root@hp-dl385pg8-08 ~]# modprobe -r nfsv4
[root@hp-dl385pg8-08 ~]# modprobe -r nfsv3
[root@hp-dl385pg8-08 ~]# modprobe -r nfs
[root@hp-dl385pg8-08 ~]# modprobe -r lockd
[root@hp-dl385pg8-08 ~]# lsmod | grep lockd
[root@hp-dl385pg8-08 ~]# systemctl start  nfs.service
A dependency job for nfs-server.service failed. See 'journalctl -xe' for details.
[root@hp-dl385pg8-08 ~]# systemctl status nfs.service -l
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
   Active: inactive (dead) since Thu 2016-06-02 02:42:45 EDT; 2min 42s ago
  Process: 21751 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
  Process: 21748 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
  Process: 21744 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
  Process: 21494 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
  Process: 21491 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
 Main PID: 21494 (code=exited, status=0/SUCCESS)

Jun 01 22:16:30 hp-dl385pg8-08.rhts.eng.pek2.redhat.com systemd[1]: Starting NFS server and services...
Jun 01 22:16:30 hp-dl385pg8-08.rhts.eng.pek2.redhat.com systemd[1]: Started NFS server and services.
Jun 02 02:42:45 hp-dl385pg8-08.rhts.eng.pek2.redhat.com systemd[1]: Stopping NFS server and services...
Jun 02 02:42:45 hp-dl385pg8-08.rhts.eng.pek2.redhat.com systemd[1]: Stopped NFS server and services.
Jun 02 02:45:16 hp-dl385pg8-08.rhts.eng.pek2.redhat.com systemd[1]: Dependency failed for NFS server and services.
Jun 02 02:45:16 hp-dl385pg8-08.rhts.eng.pek2.redhat.com systemd[1]: Job nfs-server.service/start failed with result 'dependency'.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Failed if nlm_timeout > 20
[root@hp-dl385pg8-08 ~]# cat /etc/modprobe.d/lockd.conf
options lockd nlm_timeout=21
[root@hp-dl385pg8-08 ~]# echo "options lockd nlm_timeout=20" >/etc/modprobe.d/lockd.conf
[root@hp-dl385pg8-08 ~]# cat /etc/modprobe.d/lockd.conf
options lockd nlm_timeout=20
[root@hp-dl385pg8-08 ~]# systemctl start  nfs.service
[root@hp-dl385pg8-08 ~]# systemctl status nfs.service
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
   Active: active (exited) since Thu 2016-06-02 02:47:14 EDT; 5s ago
  Process: 21751 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
  Process: 21748 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
  Process: 21744 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
  Process: 21827 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
  Process: 21825 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
 Main PID: 21827 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/nfs-server.service

Jun 02 02:47:14 hp-dl385pg8-08.rhts.eng.pek2.redhat.com systemd[1]: Starting NFS server and services...
Jun 02 02:47:14 hp-dl385pg8-08.rhts.eng.pek2.redhat.com systemd[1]: Started NFS server and services.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Success if nlm_timeout <= 20
[root@hp-dl385pg8-08 ~]# cat /sys/module/lockd/parameters/nlm_timeout 
20
[root@hp-dl385pg8-08 ~]#

Comment 17 Steve Dickson 2016-06-06 15:03:31 UTC
(In reply to Yongcheng Yang from comment #16)
> Seems cannot set the parameter "nlm_timeout" bigger than 20 While testing
> the new lockd.conf, and i still not find any explanation in man page or
> usage.
> 
> Hi Steve, does this action all right? And do we need to add some description
> about this limitation?
> 
Yes this does make sense... with the sysctl kernel interface there
are min and max constants that need to be provided.

For nlm_timeout the min and max constants are 3 and 20. 
So that is why you can't set the timeout over 30.

Comment 18 Yongcheng Yang 2016-06-07 04:13:09 UTC
(In reply to Steve Dickson from comment #17)
> (In reply to Yongcheng Yang from comment #16)
> > Seems cannot set the parameter "nlm_timeout" bigger than 20 While testing
> > the new lockd.conf, and i still not find any explanation in man page or
> > usage.
> > 
> > Hi Steve, does this action all right? And do we need to add some description
> > about this limitation?
> > 
> Yes this does make sense... with the sysctl kernel interface there
> are min and max constants that need to be provided.
> 
> For nlm_timeout the min and max constants are 3 and 20. 
> So that is why you can't set the timeout over 30.

Thanks for the clarification. It's better to add some explanation in the file /etc/modprobe.d/lockd.conf, like what "nlm_tcpport" does.

# Set the TCP port that the NFS lock manager should use. 
# port must be a valid TCP port value (1-65535). <<<<<<<<<<
#options lockd nlm_tcpport
...
# Set the default time value for the NFS lock manager
# in seconds. Default is 10 secs
#options lockd nlm_timeout=10

Comment 19 Steve Dickson 2016-06-07 13:59:22 UTC
(In reply to Yongcheng Yang from comment #18)
> 
> Thanks for the clarification. It's better to add some explanation in the
> file /etc/modprobe.d/lockd.conf, like what "nlm_tcpport" does.
> 
> # Set the TCP port that the NFS lock manager should use. 
> # port must be a valid TCP port value (1-65535). <<<<<<<<<<
> #options lockd nlm_tcpport
> ...
> # Set the default time value for the NFS lock manager
> # in seconds. Default is 10 secs
> #options lockd nlm_timeout=10
Yeah... that's probably not a bad idea...

I'll move this bz back to ON_QA when I make the change.

Comment 20 Steve Dickson 2016-06-07 18:01:05 UTC
*** Bug 1247089 has been marked as a duplicate of this bug. ***

Comment 21 Yongcheng Yang 2016-06-08 07:58:05 UTC
Checked the update mentioned in comment 19 with nfs-utils-1.3.0-0.28.el7

[root@ibm-x3250m4-07 ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.28.el7.x86_64
[root@ibm-x3250m4-07 ~]# cat /etc/modprobe.d/lockd.conf 
[snip ...]
# Set the default time value for the NFS lock manager
# in seconds. Default is 10 secs (min 3 max 20)
#options lockd nlm_timeout=10
[snip ...]
[root@ibm-x3250m4-07 ~]# 

Move to VERIFIED (again) as comment 14 and continue to run the automatic case.

Comment 23 errata-xmlrpc 2016-11-04 05:00:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2383.html


Note You need to log in before you can comment on or make changes to this bug.