Bug 2070726 - nfs-utils enables nfs-client.target and nfs-convert.service against packaging guidelines
Summary: nfs-utils enables nfs-client.target and nfs-convert.service against packaging...
Keywords:
Status: CLOSED DUPLICATE of bug 2218006
Alias: None
Product: Fedora
Classification: Fedora
Component: nfs-utils
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Steve Dickson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-31 18:48 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2023-09-17 06:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-25 19:33:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Zbigniew Jędrzejewski-Szmek 2022-03-31 18:48:32 UTC
Description of problem:
The package has:
postinstall scriptlet (using /bin/sh):
if [ $1 -eq 1 ] ; then
	# Initial installation
	/bin/systemctl enable nfs-client.target >/dev/null 2>&1 || :
	/bin/systemctl start nfs-client.target  >/dev/null 2>&1 || :
fi

See https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_scriptlets
https://docs.fedoraproject.org/en-US/packaging-guidelines/DefaultServices/#_how_to_enable_a_service_by_default

In particular, this causes problems when 'systemctl preset-all' is called. It should be possible to do this after installation, and it should be a noop if no additional presets have been installed.

Please convert nfs-utils to use the standard scriptlets and add an appropriate entry in the global presets if appropriate.

Version-Release number of selected component (if applicable):
nfs-utils-2.5.4-2.rc3.fc35.x86_64

Comment 1 Zbigniew Jędrzejewski-Szmek 2022-04-01 08:34:20 UTC
Oh, this also applies to nfs-convert.service:

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

Comment 2 Zbigniew Jędrzejewski-Szmek 2022-08-16 16:51:43 UTC
https://src.fedoraproject.org/rpms/nfs-utils/pull-request/12

Comment 3 Steve Dickson 2022-08-16 18:45:54 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #2)
> https://src.fedoraproject.org/rpms/nfs-utils/pull-request/12

Just curious... What problem is this fixing? 

Also how much testing was done with these changes
and why is the "%post -n nfsv4-client-utils"
section not needed? 

Why does the nfsv4-client-utils package, a 
client only package going a %systemd_post nfs-server.service?

Comment 4 Zbigniew Jędrzejewski-Szmek 2022-08-17 07:28:22 UTC
> Just curious... What problem is this fixing? 

As described in the original report, this is against the packaging guidelines.
Those guidelines were created to give uniformity and predictability. This package
is one of two in the distro that explicitly ignore the preset mechanism.

> why is the "%post -n nfsv4-client-utils" section not needed? 

The unit files are all in nfs-utils. So restarting the service when nfsv4-client-utils
is installed is not necessary.

Oh, I see that those files are listed in both packages!
That is strange. Service units should be located in just one package, so that ownership
is clear. And the scriptlets should be moved to that owning package then.

>  Also how much testing was done with these changes

I only tested installation/uninstallation, and that the %posttrans scriplets
remove things as expected.

Comment 5 Steve Dickson 2022-08-17 19:29:49 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #4)
> > Just curious... What problem is this fixing? 
> 
> As described in the original report, this is against the packaging
> guidelines.
> Those guidelines were created to give uniformity and predictability. This
> package
> is one of two in the distro that explicitly ignore the preset mechanism.
Years back... I could not get those those macros to work. Services were
not being enabled or started during installations or upgrades which 
is the reason I went back to them. 

Where do I look to find out what these macros actually do? 
Meaning where do I get the answer to what  does systemd_post 
and systemd_preun actually do. 

I didn't see that in the docs you pointed me to.

> 
> > why is the "%post -n nfsv4-client-utils" section not needed? 
> 
> The unit files are all in nfs-utils. So restarting the service when
> nfsv4-client-utils
> is installed is not necessary.
> 
> Oh, I see that those files are listed in both packages!
> That is strange. Service units should be located in just one package, so
> that ownership
> is clear. And the scriptlets should be moved to that owning package then.
Maybe what is not clear it is one package or the other not both. 
nfsv4-client-utils is a light weight NFS client only package, hopefully
more container friendly with less dependencies. nfs-utils is both 
client and server so they are not compatible.
 
> 
> >  Also how much testing was done with these changes
> 
> I only tested installation/uninstallation, and that the %posttrans scriplets
> remove things as expected.
That is the point... I'm pretty sure these change will break the nfsv4-client-utils
package. 

Would you mind if I take a look at this issue... using your changes
as the template, come up with a solution suitable to both of us?

Question: What is the idea behind using nfs-server.cleanup file?

Comment 6 Ben Cotton 2023-04-25 18:26:24 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 7 Ludek Smid 2023-05-25 19:33:38 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 Timothée Ravier 2023-07-25 15:00:52 UTC
This work is resumed in https://bugzilla.redhat.com/show_bug.cgi?id=2218006

*** This bug has been marked as a duplicate of bug 2218006 ***

Comment 9 Zbigniew Jędrzejewski-Szmek 2023-09-17 06:42:18 UTC
Sorry for not responding earlier. I'll take a look at the newer bug.


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