Bug 1683895

Summary: Remove "systemctl enable nfs-convert" from %post of spec file
Product: Red Hat Enterprise Linux 8 Reporter: Yongcheng Yang <yoyang>
Component: nfs-utilsAssignee: Alice Mitchell <ajmitchell>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.2CC: steved, swhiteho, xzhou
Target Milestone: rcKeywords: Triaged
Target Release: 8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nfs-utils-2.3.3-37.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:04:48 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, 1683101    
Bug Blocks:    

Description Yongcheng Yang 2019-02-28 03:58:38 UTC
Description of problem:

We may need to remove the redundant %post from nfs-utils.spec accordingly:
"""
# Enable nfs-convert so if an old configuration 
# exists a conversion will occur
/bin/systemctl enable nfs-convert  >/dev/null 2>&1 || :
"""

As soon as the Bug 1683101 got fixed, i.e., the `redhat-release`
package had already added nfsconvert.service to the presets.


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

How reproducible:
always

Steps to Reproduce:
1. rpm -q nfs-utils --scripts | grep nfs-convert
2.
3.

Actual results:
$ rpm -q nfs-utils --scripts | grep nfs-convert
# Enable nfs-convert so if an old configuration 
/bin/systemctl enable nfs-convert  >/dev/null 2>&1 || :


Expected results:
Don't use "enable/disable" explicitely

Additional info:
N/A

Comment 4 Steve Whitehouse 2020-03-12 20:12:05 UTC
Alice, can you take a look... doesn't look like it should be too tricky to resolve.

Comment 5 Yongcheng Yang 2020-03-13 06:36:35 UTC
(In reply to Yongcheng Yang from comment #0)
> ...
> As soon as the Bug 1683101 got fixed, i.e., the `redhat-release`
> package had already added nfsconvert.service to the presets.

This bug depends on this redhat-release bug (with NO progress for now):

https://bugzilla.redhat.com/show_bug.cgi?id=1683895

Comment 6 Alice Mitchell 2020-03-16 11:38:35 UTC
Having read through the associated tickets this looks like it is pending a decision on the correct way to implement it rather than needing a fix, a decision that still seems unresolved from  https://bugzilla.redhat.com/show_bug.cgi?id=1673685 despite that ticket being closed.

As far as I can see nfs-utils is not part of the minimal install, it certainly has no other mentions in the systemd presets, which would make it wrong to add nfsconvert to the presets as I presume it would create a dependancy thus growing the minimal install.

Is there some reason that the rules in nfs-convert.service do not already handle things, so we can just drop this from the spec file entirely?

And given that, why are there other manual calls to systemctl in the %post rules of the spec file? shouldn't they also already be handled by the dependancies?

Unless there is some known reason why the spec file calls to systemctl are still needed I will remove them and test that the services files adequately do the job instead.

Comment 7 Steve Dickson 2020-03-16 17:26:03 UTC
My apologies.... I just don't see what the problem is here...

Comment 8 Yongcheng Yang 2020-06-20 03:42:09 UTC
(In reply to Yongcheng Yang from comment #0)
> ...
> As soon as the Bug 1683101 got fixed, i.e., the `redhat-release`
> package had already added nfsconvert.service to the presets.
> 

The redhat-release-8.3-0.2.el8 has enabled nfs-convert now:
~~~~~~~~~~~~~~~~~~~~~~~~
etoot@rhel-8-3-latest ~]# tail -2 /usr/lib/systemd/system-preset/90-default.preset
# https://bugzilla.redhat.com/show_bug.cgi?id=1683101
enable nfs-convert.service
etoot@rhel-8-3-latest ~]# rpm -qf /usr/lib/systemd/system-preset/90-default.preset
redhat-release-8.3-0.2.el8.x86_64

This is no necessary in nfs-utils.spec %post code to enable it once again:

> # Enable nfs-convert so if an old configuration 
> # exists a conversion will occur
> /bin/systemctl enable nfs-convert  >/dev/null 2>&1 || :

Comment 11 Yongcheng Yang 2020-08-25 13:30:32 UTC
(In reply to Yongcheng Yang from comment #8)
> 
> The redhat-release-8.3-0.2.el8 has enabled nfs-convert now:
> ~~~~~~~~~~~~~~~~~~~~~~~~
> etoot@rhel-8-3-latest ~]# tail -2
> /usr/lib/systemd/system-preset/90-default.preset
> # https://bugzilla.redhat.com/show_bug.cgi?id=1683101
> enable nfs-convert.service
> etoot@rhel-8-3-latest ~]# rpm -qf
> /usr/lib/systemd/system-preset/90-default.preset
> redhat-release-8.3-0.2.el8.x86_64
> 
> This is no necessary in nfs-utils.spec %post code to enable it once again:
> 
> > # Enable nfs-convert so if an old configuration 
> > # exists a conversion will occur
> > /bin/systemctl enable nfs-convert  >/dev/null 2>&1 || :

No need to enable nfs-convert in spec file as it's enabled by `redhat-release` presets.

Comment 15 Alice Mitchell 2020-12-10 12:15:55 UTC
Confirmed that nfs-convert is enabled by default now, no need to keep this in the spec file

Comment 22 Yongcheng Yang 2020-12-17 04:04:42 UTC
Verified on the latst nfs-utils:

[root@ ~]# rpm -q nfs-utils
nfs-utils-2.3.3-40.el8.x86_64
[root@ ~]# rpm -q nfs-utils --scripts | grep nfs-convert
[root@ ~]# systemctl is-enabled nfs-convert
enabled
[root@ ~]#

Comment 24 errata-xmlrpc 2021-05-18 15:04:48 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 (nfs-utils bug fix and enhancement update), 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-2021:1669