Bug 1688932

Summary: sm-notify: add flag "-f" to nfs.conf parsing (RHEL7)
Product: Red Hat Enterprise Linux 7 Reporter: Steve Dickson <steved>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.7CC: ajmitchell, rhandlin, toneata, xzhou, yieli, yoyang
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-utils-1.3.0-0.63.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1677576 Environment:
Last Closed: 2019-08-06 13:11:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1677576, 1716592    
Bug Blocks:    

Description Steve Dickson 2019-03-14 18:07:24 UTC
+++ This bug was initially created as a clone of Bug #1677576 +++

Description of problem:
Fail to process the sm-notify option "-f" when converting /etc/sysconfig/nfs.
I.e.
[root]# cat /etc/sysconfig/nfs
SMNOTIFYARGS="-f"
[root]# nfsconvert
option -f not recognized
Error whilst converting SMNOTIFYARGS to nfsconf options.

Conversion failed. Please correct the error and try again.
[root]# man sm-notify | grep "\-f"
       -f     Send notifications even if sm-notify has already run since the last system reboot.
[root]# rpm -q nfs-utils
nfs-utils-2.3.3-13.el8.x86_64


Version-Release number of selected component (if applicable):
nfs-utils-2.3.3-13.el8

How reproducible:
always

Additional info:
Maybe this option is invalid and can be ignored now.
As I cannot find the corresponding param in /etc/nfs.conf:
~~~
[sm-notify]
# debug=0
# retry-time=900
# outgoing-port=
# outgoing-addr=
# lift-grace=y
~~~

(delay to 8.1 as this issue is trivial and it's too late for 8.0 now)

--- Additional comment from Steve Dickson on 2019-02-15 14:26:25 UTC ---

This is upstream problem since sm-notify does not look for
the force flag in nfs.conf.... Here is the proposed upstream
patch

https://marc.info/?l=linux-nfs&m=155023975505290&w=2

nfsconvert.py will have to be modified to deal with the flag
which look fairly easy...

--- Additional comment from Yongcheng Yang on 2019-02-18 04:31:02 UTC ---

(In reply to Steve Dickson from comment #1)
> This is upstream problem since sm-notify does not look for
> the force flag in nfs.conf.... Here is the proposed upstream
> patch
> 
> https://marc.info/?l=linux-nfs&m=155023975505290&w=2
> 
> nfsconvert.py will have to be modified to deal with the flag
> which look fairly easy...

Updating bug summary according to the above info. Thanks!

--- Additional comment from Steve Dickson on 2019-03-05 15:24:42 UTC ---

commit 3762a464a8cd7afa42e616194cc7fcd1d200c1ad
Author: Steve Dickson <steved>
Date:   Fri Mar 1 15:23:47 2019 -0500

    sm-notify: Added -f flag to nfs.conf parsing
    
    Cleaned up the nfs.conf parsing and added the setting
    of the force to the nfs.conf parsing
    
    Signed-off-by: Steve Dickson <steved>

--- Additional comment from Yongcheng Yang on 2019-03-08 09:50:01 UTC ---

Please note the patch of comment #3 has been merged in nfs-utils-2.3.3-15.el8 now.

(In reply to Steve Dickson from comment #1)
> ...
> nfsconvert.py will have to be modified to deal with the flag
> which look fairly easy...

However, the nfsconver script is still as previous and needs an update.
So I'm just removing the fixed version for now.


Testing logs:
~~~~~~~~~~~~~~~
[root.0 ~]# cat /etc/nfs.conf
[sm-notify]
# force=0
[root.0 ~]# >/var/log/messages && systemctl restart rpc-statd-notify
[root.0 ~]# grep notify /var/log/messages
Mar  8 04:43:11 8.1.0 sm-notify[38360]: Version 2.3.3 starting
Mar  8 04:43:11 8.1.0 sm-notify[38360]: Already notifying clients; Exiting! <--- by default
[root.0 ~]#
[root.0 ~]# vi /etc/nfs.conf
[root.0 ~]# cat /etc/nfs.conf
[sm-notify]
 force=1
[root.0 ~]# >/var/log/messages && systemctl restart rpc-statd-notify
[root.0 ~]# grep notify /var/log/messages
Mar  8 04:43:35 8.1.0 sm-notify[38378]: Version 2.3.3 starting  <--- No exit now
[root.0 ~]# >/var/log/messages && systemctl restart rpc-statd-notify
[root.0 ~]# grep notify /var/log/messages
Mar  8 04:43:42 8.1.0 sm-notify[38387]: Version 2.3.3 starting  <--- No exit now
[root.0 ~]# 
[root.0 ~]# >/etc/nfs.conf
[root.0 ~]# vi /etc/sysconfig/nfs
[root.0 ~]# cat /etc/sysconfig/nfs
SMNOTIFYARGS="-f"
[root.0 ~]# nfsconvert 
option -f not recognized
Error whilst converting SMNOTIFYARGS to nfsconf options.

Conversion failed. Please correct the error and try again.
~~~~~~~~~~~~~~~

--- Additional comment from Justin Mitchell on 2019-03-08 13:04 UTC ---

Comment 3 Yongcheng Yang 2019-03-15 01:14:24 UTC
I'm updating this summary a bit as the nfsconver script is only for rhel8.

Comment 5 Yongcheng Yang 2019-04-01 07:06:49 UTC
Have verified in nfs-utils-1.3.0-0.63.el7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://beaker.engineering.redhat.com/recipes/6687133#task90429735
------------------------------------------------------------------
[23:44:09 root@ ~~]# cat /etc/nfs.conf
[sm-notify]
 force = 1
[23:44:09 root@ ~~]# systemctl restart rpc-statd-notify
[23:44:09 root@ ~~]# grep "sm-notify.*Exiting" /var/log/messages
[23:44:09 root@ ~~]# sm-notify
[23:44:09 root@ ~~]# grep "sm-notify.*Exiting" /var/log/messages

Compared with previous version 61.el7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.61.el7.x86_64
[root ~]# cat /etc/nfs.conf
[sm-notify]
 force=1
[root ~]# systemctl restart rpc-statd-notify
[root ~]# grep "sm-notify.*Exiting" /var/log/messages
Apr  1 03:04:12 rhel-7.6 sm-notify[1784]: Already notifying clients; Exiting!
[root ~]# sm-notify 
[root ~]# grep "sm-notify.*Exiting" /var/log/messages
Apr  1 03:04:12 rhel-7.6 sm-notify[1784]: Already notifying clients; Exiting!
Apr  1 03:04:23 rhel-7.6 sm-notify[1788]: Already notifying clients; Exiting!
[root ~]# 

Moving to VERIFIED now.

Comment 7 errata-xmlrpc 2019-08-06 13:11:50 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-2019:2268