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.
Bug 1297429 - %ghost file not removed upon subpackage uninstall
Summary: %ghost file not removed upon subpackage uninstall
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpm
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Florian Festi
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-11 13:43 UTC by Jaroslav Škarvada
Modified: 2016-04-12 13:17 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-12 13:17:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jaroslav Škarvada 2016-01-11 13:43:18 UTC
Description of problem:
From the RPM docs [1] (and my previous behaviour with RPM) %ghost files should be removed upon package uninstallation, but the following %ghost file from the Tuned subpackage isn't removed. We have the following in the SPEC file:

..
%install
mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d
touch %{buildroot}%{_sysconfdir}/modprobe.d/kvm.rt.tuned.conf

%files
....

%files profiles-nfv
ghost %{_sysconfdir}/modprobe.d/kvm.rt.tuned.conf
...

[1] http://www.rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-GHOST-DIRECTIVE

Version-Release number of selected component (if applicable):
rpm-4.11.3-17.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. git clone "https://git.fedorahosted.org/git/tuned.git"
2. cd tuned
3. make rpm
4. cd ~/rpmbuild/RPMS/noarch
5. yum install ./tuned-*.rpm
6. rpm -i --nodeps ./tuned-profiles-nfv*.rpm
7. touch /etc/modprobe.d/kvm.rt.tuned.conf
8. rpm -e tuned-profiles-nfv
9. ls /etc/modprobe.d/kvm.rt.tuned.conf

Actual results:
/etc/modprobe.d/kvm.rt.tuned.conf

Expected results:
ls: cannot access /etc/modprobe.d/kvm.rt.tuned.conf: No such file or directory

Additional info:
# rpm -evvv tuned-profiles-nfv
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D: loading keyring from rpmdb
D: opening  db environment /var/lib/rpm cdb:0x401
D: opening  db index       /var/lib/rpm/Packages 0x400 mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Name 0x400 mode=0x0
D:  read h#    1325 Header SHA1 digest: OK (663942ef536f31509f5414ead27f529fdca00062)
D: opening  db index       /var/lib/rpm/Conflictname 0x400 mode=0x0
D: ========== --- tuned-profiles-nfv-2.6.0-1.el7 noarch/linux 0x0
D: opening  db index       /var/lib/rpm/Requirename 0x400 mode=0x0
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, depth)
D:     0    0    0    1   -tuned-profiles-nfv-2.6.0-1.el7.noarch
D: erasing packages
D: closed   db index       /var/lib/rpm/Conflictname
D: closed   db index       /var/lib/rpm/Requirename
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm
D: opening  db environment /var/lib/rpm cdb:0x401
D: opening  db index       /var/lib/rpm/Packages (none) mode=0x42
D: sanity checking 1 elements
D: running pre-transaction scripts
D: computing 15 file fingerprints
D: opening  db index       /var/lib/rpm/Name (none) mode=0x42
D: opening  db index       /var/lib/rpm/Basenames (none) mode=0x42
D: opening  db index       /var/lib/rpm/Group (none) mode=0x42
D: opening  db index       /var/lib/rpm/Requirename (none) mode=0x42
D: opening  db index       /var/lib/rpm/Providename (none) mode=0x42
D: opening  db index       /var/lib/rpm/Conflictname (none) mode=0x42
D: opening  db index       /var/lib/rpm/Obsoletename (none) mode=0x42
D: opening  db index       /var/lib/rpm/Triggername (none) mode=0x42
D: opening  db index       /var/lib/rpm/Dirnames (none) mode=0x42
D: opening  db index       /var/lib/rpm/Installtid (none) mode=0x42
D: opening  db index       /var/lib/rpm/Sigmd5 (none) mode=0x42
D: opening  db index       /var/lib/rpm/Sha1header (none) mode=0x42
Preparing packages...
D: computing file dispositions
D: 0x0000fd01     4096      2540084     13471870 /
D: ========== +++ tuned-profiles-nfv-2.6.0-1.el7 noarch-linux 0x0
D:  read h#    1325 Header SHA1 digest: OK (663942ef536f31509f5414ead27f529fdca00062)
D:     erase: tuned-profiles-nfv-2.6.0-1.el7 has 15 files
tuned-profiles-nfv-2.6.0-1.el7.noarch
D: erase      100644  1 (   0,   0)   862 /usr/share/man/man7/tuned-profiles-nfv.7.gz
D: erase      100644  2 (   0,   0)  3137 /usr/libexec/tuned/defirqaffinity.pyo
D: erase      100644  1 (   0,   0)  3137 /usr/libexec/tuned/defirqaffinity.pyc
D: erase      100755  1 (   0,   0)  3151 /usr/libexec/tuned/defirqaffinity.py
D: erase      100644  1 (   0,   0)  1253 /usr/lib/tuned/realtime-virtual-host/tuned.conf
D: erase      100755  1 (   0,   0)  2620 /usr/lib/tuned/realtime-virtual-host/script.sh
D: erase      100755  1 (   0,   0)   734 /usr/lib/tuned/realtime-virtual-host/run-tscdeadline-latency.sh
D: erase      100755  1 (   0,   0)   686 /usr/lib/tuned/realtime-virtual-host/find-lapictscdeadline-optimal.sh
D: erase      040755  2 (   0,   0)     6 /usr/lib/tuned/realtime-virtual-host
D: erase      100644  1 (   0,   0)   489 /usr/lib/tuned/realtime-virtual-guest/tuned.conf
D: erase      100755  1 (   0,   0)   506 /usr/lib/tuned/realtime-virtual-guest/script.sh
D: erase      040755  2 (   0,   0)     6 /usr/lib/tuned/realtime-virtual-guest
D: erase      100644  1 (   0,   0)    59 /etc/tuned/realtime-virtual-host-variables.conf
D: erase      100644  1 (   0,   0)    59 /etc/tuned/realtime-virtual-guest-variables.conf
D: backup     100644  1 (   0,   0)     0 /etc/modprobe.d/kvm.rt.tuned.conf
D:   --- h#    1325 tuned-profiles-nfv-2.6.0-1.el7.noarch
D: removing "tuned-profiles-nfv" from Name index.
D: removing 15 entries from Basenames index.
D: removing "Unspecified" from Group index.
D: removing 13 entries from Requirename index.
D: removing 2 entries from Providename index.
D: removing 7 entries from Dirnames index.
D: removing 1 entries from Installtid index.
D: removing 1 entries from Sigmd5 index.
D: removing "663942ef536f31509f5414ead27f529fdca00062" from Sha1header index.
D: running post-transaction scripts
D: closed   db index       /var/lib/rpm/Sha1header
D: closed   db index       /var/lib/rpm/Sigmd5
D: closed   db index       /var/lib/rpm/Installtid
D: closed   db index       /var/lib/rpm/Dirnames
D: closed   db index       /var/lib/rpm/Triggername
D: closed   db index       /var/lib/rpm/Obsoletename
D: closed   db index       /var/lib/rpm/Conflictname
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Requirename
D: closed   db index       /var/lib/rpm/Group
D: closed   db index       /var/lib/rpm/Basenames
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm

Notice the:
D: backup     100644  1 (   0,   0)     0 /etc/modprobe.d/kvm.rt.tuned.conf

It is not marked as config file, thus it should be deleted.

Comment 3 Karel Srot 2016-04-04 14:21:30 UTC
I am not able to reproduce this problem. Neither with my simplified test scenario nor with the original reproducer from the bug description.
Could you please confirm that the problem really exists?

# rpm -q rpm
rpm-4.11.3-17.el7.x86_64
# rpm -i --nodeps /root/rpmbuild/RPMS/noarch/tuned-profiles-nfv-2.6.0-1.el7.noarch.rpm
# touch /etc/modprobe.d/kvm.rt.tuned.conf
# ls /etc/modprobe.d/kvm.rt.tuned.conf
/etc/modprobe.d/kvm.rt.tuned.conf
# rpm -qf /etc/modprobe.d/kvm.rt.tuned.conf
tuned-profiles-nfv-2.6.0-1.el7.noarch
# rpm -e tuned-profiles-nfv-2.6.0-1.el7.noarch
# ls /etc/modprobe.d/kvm.rt.tuned.conf
ls: cannot access /etc/modprobe.d/kvm.rt.tuned.conf: No such file or directory

Comment 5 Jaroslav Škarvada 2016-04-12 10:34:43 UTC
I am going to recheck

Comment 6 Jaroslav Škarvada 2016-04-12 13:17:47 UTC
Now it works for me, thus closing.


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