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 1413272 - nlockmgr no longer reading /etc/sysconfig/nfs file for LOCKD_TCPPORT and LOCKD_UDPPORT values
Summary: nlockmgr no longer reading /etc/sysconfig/nfs file for LOCKD_TCPPORT and LOCK...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: Yongcheng Yang
URL:
Whiteboard:
Depends On:
Blocks: 1420851
TreeView+ depends on / blocked
 
Reported: 2017-01-14 09:30 UTC by Madhur Gupta
Modified: 2021-12-10 14:52 UTC (History)
7 users (show)

Fixed In Version: nfs-utils-1.3.0-0.57.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1624666 (view as bug list)
Environment:
Last Closed: 2018-10-30 11:48:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1264387 0 unspecified CLOSED change to use lockd.conf instead of sysconfig to set module lockd parameters 2021-02-22 00:41:40 UTC
Red Hat Knowledge Base (Solution) 3638791 0 None None None 2018-10-04 05:33:02 UTC
Red Hat Product Errata RHBA-2018:3311 0 None None None 2018-10-30 11:48:44 UTC

Internal Links: 1264387

Description Madhur Gupta 2017-01-14 09:30:17 UTC
Description of problem:
nlockmgr no longer reading /etc/sysconfig/nfs file for LOCKD_TCPPORT and LOCKD_UDPPORT values, then have to define values in below values into /etc/modprobe.d/lockd.conf for workaround:

 # egrep 32[78] /etc/modprobe.d/lockd.conf
  options lockd nlm_tcpport=32803
  options lockd nlm_udpport=32769



Version-Release number of selected component (if applicable):


How reproducible:

After upgrading nfs-utils to nfs-utils-1.3.0-0.33.el7.x86_64 and rebooting, nlockmgr no longer reading /etc/sysconfig/nfs file for LOCKD_TCPPORT and LOCKD_UDPPORT values.

# rpcinfo -p | egrep 32[78]
#
# grep 32[78] /etc/sysconfig/nfs
#LOCKD_TCPPORT=32803
#LOCKD_UDPPORT=32769
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
#
# rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp    662  status
    100024    1   tcp    662  status
    100005    1   udp    892  mountd
    100005    1   tcp    892  mountd
    100005    2   udp    892  mountd
    100005    2   tcp    892  mountd
    100005    3   udp    892  mountd
    100005    3   tcp    892  mountd
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    3   tcp   2049  nfs_acl
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100227    3   udp   2049  nfs_acl
    100021    1   udp  46424  nlockmgr
    100021    3   udp  46424  nlockmgr
    100021    4   udp  46424  nlockmgr
    100021    1   tcp  46091  nlockmgr
    100021    3   tcp  46091  nlockmgr
    100021    4   tcp  46091  nlockmgr



Steps to Reproduce:
1.
2.
3.

Actual results:
#
# cat /sys/module/lockd/parameters/nlm_tcpport
0
#
# cat /sys/module/lockd/parameters/nlm_udpport
0
#


Expected results:
#
  # cat /sys/module/lockd/parameters/nlm_udpport
  32769
  # cat /sys/module/lockd/parameters/nlm_tcpport
  32803
  #

Additional info:

Current workaround is as follows.

1) Update newly added file /etc/modprobe.d/lockd.conf to nfs-utils as follows:
   
  # egrep 32[78] /etc/modprobe.d/lockd.conf
  options lockd nlm_tcpport=32803
  options lockd nlm_udpport=32769
  #

2) Stop following services
  # systemctl stop proc-fs-nfsd.mount rpcbind.socket
  # systemctl stop nfs-server rpcbind nfs-lock nfs-idmap nfs-config

3) Unload nfsd modules
  # modprobe -r nfsd
  #

4) Restart services stopped in step 2 
  # systemctl start nfs-server rpcbind nfs-lock nfs-idmap nfs-config
  # 

5) Verify correct ports in use
  # rpcinfo -p | egrep 32[78]
    100021    1   udp  32769  nlockmgr
    100021    3   udp  32769  nlockmgr
    100021    4   udp  32769  nlockmgr
    100021    1   tcp  32803  nlockmgr
    100021    3   tcp  32803  nlockmgr
    100021    4   tcp  32803  nlockmgr
  #
  # cat /sys/module/lockd/parameters/nlm_udpport
  32769
  # cat /sys/module/lockd/parameters/nlm_tcpport
  32803
  #

Comment 2 Yongcheng Yang 2017-01-16 02:41:53 UTC
As Bug 1264387 Comment #11 mentioned, we have changed to use lockd.conf instead of sysconfig to set module lockd parameters since nfs-utils-1.3.0-0.28.el7

Comment 3 Madhur Gupta 2017-01-18 10:07:54 UTC
Thank you! Yongcheng.

So as this is an expected behavior shall we close this ticket as not a bug ?

Comment 4 Madhur Gupta 2017-01-18 10:12:31 UTC
Sorry, I got little confused here, it is expected to read values from module lockd parameter or frp, lockd.conf file here ?

Comment 5 Yongcheng Yang 2017-01-18 10:39:30 UTC
(In reply to Madhur Gupta from comment #3)
> Thank you! Yongcheng.
> 
> So as this is an expected behavior shall we close this ticket as not a bug ?

IMHO, just closing this one as duplicate to bug 1264387 is enough.


(In reply to Madhur Gupta from comment #4)
> Sorry, I got little confused here, it is expected to read values from module
> lockd parameter or frp, lockd.conf file here ?

I only use the config file "lockd.conf" ("/etc/sysconfig/nfs" previously) to specify the lockd parameters. Sorry that I don't know if there is any other method.

------------------------------------------------------------------
[root ~]# grep '.*' -r /sys/module/lockd/parameters/
/sys/module/lockd/parameters/nlm_grace_period:0
/sys/module/lockd/parameters/nlm_tcpport:0
/sys/module/lockd/parameters/nlm_max_connections:1024
/sys/module/lockd/parameters/nlm_timeout:10
/sys/module/lockd/parameters/nsm_use_hostnames:N
/sys/module/lockd/parameters/nlm_udpport:0
[root ~]# cat /etc/modprobe.d/lockd.conf 
#
# 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 (min 3 max 20)
#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
[root ~]# rpm -qf /etc/modprobe.d/lockd.conf
nfs-utils-1.3.0-0.33.el7.x86_64

Comment 18 Yongcheng Yang 2018-07-27 10:00:02 UTC
The "lockd" options in /etc/sysconfig/nfs have already been added back in nfs-utils-1.3.0-0.57.el7

Now we have 2 ways to set lockd module's option:
 - via /etc/sysconfig/nfs
 - via /etc/modprobe.d/lockd.conf

From the results of some simple tests, looks like:
- Which configuration taking effect depends on how to load the "lockd" module. I.e.
 * "modprobe lockd" reads config from "/etc/modprobe.d/lockd.conf"
 * "systemctl restart nfs-config" reads config "/etc/sysconfig/nfs"
- After loaded, "LOCKD_TCPPORT" and "LOCKD_UDPPORT" can be modified by restarting nfs-config and reading "/etc/sysconfig/nfs"
- After loaded, other value of "LOCKDARG" cannot be modified unless re-loading it.

This re-expose the issue I reported in Bug 1264387, i.e., "LOCKDARG" of "/etc/sysconfig/nfs" doesn't take effect after restarting nfs-config.service.
However, looks to me now it's probably not a problem.


Please have a look at the testing logs:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.57.el7.x86_64
[root~]# 
[root~]# cat /etc/modprobe.d/lockd.conf
options lockd nlm_grace_period=90
options lockd nlm_tcpport=33333
options lockd nlm_udpport=33334
[root~]# 
[root~]# cat /etc/sysconfig/nfs
LOCKDARG="nlm_grace_period=120"
LOCKD_TCPPORT=55556
LOCKD_UDPPORT=55557
[root~]# 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# load "lockd" by nfs-config.service, it's configured by
# /etc/sysconfig/nfs and all values cannot be changed by
# /etc/modprobe.d/lockd.conf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root~]# rmmod lockd
[root~]# systemctl restart nfs-config
[root~]# sysctl fs.nfs | grep -E "grace|port"
fs.nfs.nlm_grace_period = 120
fs.nfs.nlm_tcpport = 55556
fs.nfs.nlm_udpport = 55557
[root~]# modprobe lockd
[root~]# sysctl fs.nfs | grep -E "grace|port"
fs.nfs.nlm_grace_period = 120
fs.nfs.nlm_tcpport = 55556
fs.nfs.nlm_udpport = 55557
[root~]# 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# load "lockd" by command "modprobe", it's configured by
# /etc/modprobe.d/lockd.conf at first and nlm_{tcp,udp}port
# can be updated by /etc/sysconfig/nfs when restarting nfs-config
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root~]# rmmod lockd
[root~]# modprobe lockd
[root~]# sysctl fs.nfs | grep -E "grace|port"
fs.nfs.nlm_grace_period = 90
fs.nfs.nlm_tcpport = 33333
fs.nfs.nlm_udpport = 33334
[root~]# systemctl restart nfs-config
[root~]# sysctl fs.nfs | grep -E "grace|port"
fs.nfs.nlm_grace_period = 90
fs.nfs.nlm_tcpport = 55556     <<<<<<<<<<<<<<<<<<<<
fs.nfs.nlm_udpport = 55557     <<<<<<<<<<<<<<<<<<<<
[root~]#

Comment 19 Yongcheng Yang 2018-07-31 03:36:53 UTC
Moving to VERIFIED according to comment #18.

Comment 21 errata-xmlrpc 2018-10-30 11:48:04 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://access.redhat.com/errata/RHBA-2018:3311


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