Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
I'm so sorry for not getting to this before.
It must have came in the middle of a bunch of other bugzilla's and I just went by it without looking.
The problem is with the %preun section of the spec file.
In there you are doing
rm -rf /var/lib/nfs/statd
rm -rf /var/lib/nfs/v4recovery
And yet in your %files section you have
%dir %{_sharedstatedir}/nfs/v4recovery
%dir %attr(700,rpcuser,rpcuser) %{_sharedstatedir}/nfs/statd
%dir %attr(700,rpcuser,rpcuser) %{_sharedstatedir}/nfs/statd/sm
%dir %attr(700,rpcuser,rpcuser) %{_sharedstatedir}/nfs/statd/sm.bak
So, when it get's to the files section, it gives a non-fatal error. It's trying to remove files that you have already removed manually.
My suggestion, don't remove files in %preun. If you need to, don't do such a wide deletion. Maybe something like
rm -rf /var/lib/nfs/v4recovery/*
The last line
warning: directory /var/lib/nfs/rpc_pipefs: remove failed: Device or resource busy
Sounds like some service was not turned off before uninstalling.
Looking at the %preun script, I believe it is sortof right in the spec file, but there must be a bug in the %systemd_preun macro.
This is what actually is in the %preun script.
# rpm -q --scripts nfs-utils
...
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable nfs-server.server > /dev/null 2>&1 || :
systemctl stop nfs-server.server > /dev/null 2>&1 || :
fi
...
That is trying to stop nfs-server.server not nfs-server.service
If you try doing the script by hand you get
# systemctl stop nfs-server.server
Failed to stop nfs-server.server.service: Unit nfs-server.server.service not loaded.
# systemctl status nfs-server.server
Unit nfs-server.server.service could not be found.
But if you switch it to nfs-server.service you get
# systemctl stop nfs-server.service
# systemctl status nfs-server.service
● nfs-server.service - NFS server and services
Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
Active: inactive (dead)
I hope this helps.
As I assume the intention here is to ensure this directory and its contents are always removed, either the %preun commands should be modified to empty the directory whilst leaving the actually directory there for %files to clean up, or simply move the cleanup to %postun
Created attachment 1720966[details]
Patch to cleanup the warnings
Moving the directory removal into %postun scriplet ensures that cleanup happens but doesnt trigger the warnings
I don't think it will cause an issue as both the %preun and %postun try to stop the same service, and it doesn't generate any errors or warnings that I can see. there is probably scope to clean that up however
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
I'm so sorry for not getting to this before. It must have came in the middle of a bunch of other bugzilla's and I just went by it without looking. The problem is with the %preun section of the spec file. In there you are doing rm -rf /var/lib/nfs/statd rm -rf /var/lib/nfs/v4recovery And yet in your %files section you have %dir %{_sharedstatedir}/nfs/v4recovery %dir %attr(700,rpcuser,rpcuser) %{_sharedstatedir}/nfs/statd %dir %attr(700,rpcuser,rpcuser) %{_sharedstatedir}/nfs/statd/sm %dir %attr(700,rpcuser,rpcuser) %{_sharedstatedir}/nfs/statd/sm.bak So, when it get's to the files section, it gives a non-fatal error. It's trying to remove files that you have already removed manually. My suggestion, don't remove files in %preun. If you need to, don't do such a wide deletion. Maybe something like rm -rf /var/lib/nfs/v4recovery/* The last line warning: directory /var/lib/nfs/rpc_pipefs: remove failed: Device or resource busy Sounds like some service was not turned off before uninstalling. Looking at the %preun script, I believe it is sortof right in the spec file, but there must be a bug in the %systemd_preun macro. This is what actually is in the %preun script. # rpm -q --scripts nfs-utils ... if [ $1 -eq 0 ] ; then # Package removal, not upgrade systemctl --no-reload disable nfs-server.server > /dev/null 2>&1 || : systemctl stop nfs-server.server > /dev/null 2>&1 || : fi ... That is trying to stop nfs-server.server not nfs-server.service If you try doing the script by hand you get # systemctl stop nfs-server.server Failed to stop nfs-server.server.service: Unit nfs-server.server.service not loaded. # systemctl status nfs-server.server Unit nfs-server.server.service could not be found. But if you switch it to nfs-server.service you get # systemctl stop nfs-server.service # systemctl status nfs-server.service ● nfs-server.service - NFS server and services Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled) Active: inactive (dead) I hope this helps.