Bug 1677576

Summary: sm-notify: add flag "-f" to nfs.conf parsing and update nfsconvert to deal with SMNOTIFYARGS="-f" of /etc/sysconfig/nfs
Product: Red Hat Enterprise Linux 8 Reporter: Yongcheng Yang <yoyang>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: ajmitchell, rhandlin, stefw, tbowling, toneata, xzhou, yieli
Target Milestone: rcKeywords: Patch, ZStream
Target Release: 8.1Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-utils-2.3.3-16.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1688932 1716592 (view as bug list) Environment:
Last Closed: 2019-11-05 22:18:26 UTC Type: Bug
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: 1653927, 1681972    
Bug Blocks: 1688932, 1716592    
Attachments:
Description Flags
Patch for nfsconvert.py none

Description Yongcheng Yang 2019-02-15 09:36:27 UTC
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)

Comment 1 Steve Dickson 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...

Comment 2 Yongcheng Yang 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!

Comment 3 Steve Dickson 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>

Comment 4 Yongcheng Yang 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.
~~~~~~~~~~~~~~~

Comment 5 Alice Mitchell 2019-03-08 13:04:26 UTC
Created attachment 1542114 [details]
Patch for nfsconvert.py

Comment 11 Yongcheng Yang 2019-08-12 02:16:33 UTC
Verified this in the latest version nfs-utils-2.3.3-23.el8

https://beaker.engineering.redhat.com/recipes/7218890#task97501801
------------------------------------------------------
# do-Test-option "-f"
[06:41:25 root@ ~~]# sleep 1 && >/var/log/messages
[06:41:26 root@ ~~]# sm-notify -f
[06:41:26 root@ ~~]# grep "sm-notify.*Exiting" /var/log/messages
                   <<<<<<<<< sm-notify NOT exit

# Apply configuration settings to /etc/nfs.conf
[06:41:28 root@ ~~]# >/etc/nfs.conf
[06:41:28 root@ ~~]# systemctl reset-failed
[06:41:28 root@ ~~]# echo -e "SMNOTIFYARGS=\"-f\"" > /etc/sysconfig/nfs
[06:41:28 root@ ~~]# systemctl restart rpc-statd-notify
[06:41:28 root@ ~~]# cat /etc/nfs.conf
[sm-notify]
force = 1
^^^^^^^^^^^       <<<<<<<<< nfsconvert executed
[06:41:28 root@ ~~]# journalctl --since='2019-08-09 06:41:28' | grep 'sm-notify.*Exiting'
[06:41:28 root@ ~~]# sm-notify
[06:41:28 root@ ~~]# journalctl --since='2019-08-09 06:41:28' | grep 'sm-notify.*Exiting'
                   <<<<<<<<< sm-notify NOT exit
------------------------------------------------------

Moving to VERIFIED now.

Comment 13 errata-xmlrpc 2019-11-05 22:18:26 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:3579