Bug 1549178
| Summary: | Cannot uninstall kmod-kvdo RPM if modules are not loaded | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Andy Walsh <awalsh> | ||||
| Component: | kmod-kvdo | Assignee: | Andy Walsh <awalsh> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Jakub Krysl <jkrysl> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 7.5 | CC: | awalsh, bgurney, jkrysl, rhandlin | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | 6.1.0.153 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2018-04-10 16:27:17 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: | |||||||
| Attachments: |
|
||||||
|
Description
Andy Walsh
2018-02-26 15:40:04 UTC
I have a proposed fix that I am testing right now. I installed the updated package into the mock environment and then removed it successfully. Here is the output: [awalsh@awalsh ~]$ sudo mock -r /etc/mock/rhel-7.5-x86_64.cfg --install kmod-kvdo-6.1.0.149-14.el7.x86_64.rpm INFO: mock.py version 1.4.8 starting (python version = 2.7.5)... Start: init plugins INFO: selinux disabled Finish: init plugins Start: run Start: chroot init INFO: calling preinit hooks INFO: enabled root cache INFO: enabled yum cache Start: cleaning yum metadata Finish: cleaning yum metadata INFO: enabled HW Info plugin Mock Version: 1.4.8 INFO: Mock Version: 1.4.8 Finish: chroot init INFO: installing package(s): kmod-kvdo-6.1.0.149-14.el7.x86_64.rpm Failed to set locale, defaulting to C Examining kmod-kvdo-6.1.0.149-14.el7.x86_64.rpm: kmod-kvdo-6.1.0.149-14.el7.x86_64 Marking kmod-kvdo-6.1.0.149-14.el7.x86_64.rpm to be installed Resolving Dependencies --> Running transaction check ---> Package kmod-kvdo.x86_64 0:6.1.0.149-14.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================================================================================== Package Arch Version Repository Size ============================================================================================================================================================================================================================================== Installing: kmod-kvdo x86_64 6.1.0.149-14.el7 /kmod-kvdo-6.1.0.149-14.el7.x86_64 1.2 M Transaction Summary ============================================================================================================================================================================================================================================== Install 1 Package Total size: 1.2 M Installed size: 1.2 M Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : kmod-kvdo-6.1.0.149-14.el7.x86_64 1/1 /sbin/dracut: line 655: warning: setlocale: LC_MESSAGES: cannot change locale () /sbin/dracut: line 655: warning: setlocale: LC_MESSAGES: cannot change locale () No '/dev/log' or 'logger' included for syslog logging Turning off host-only mode: '/run' is not mounted! Turning off host-only mode: '/dev' is not mounted! Verifying : kmod-kvdo-6.1.0.149-14.el7.x86_64 1/1 Installed: kmod-kvdo.x86_64 0:6.1.0.149-14.el7 Complete! INFO: None Finish: run And then the remove: <mock-chroot> sh-4.2# rpm -qa | grep vdo kmod-kvdo-6.1.0.149-14.el7.x86_64 <mock-chroot> sh-4.2# yum remove kmod-kvdo Resolving Dependencies --> Running transaction check ---> Package kmod-kvdo.x86_64 0:6.1.0.149-14.el7 will be erased --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================================================================================== Package Arch Version Repository Size ============================================================================================================================================================================================================================================== Removing: kmod-kvdo x86_64 6.1.0.149-14.el7 installed 1.2 M Transaction Summary ============================================================================================================================================================================================================================================== Remove 1 Package Installed size: 1.2 M Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Erasing : kmod-kvdo-6.1.0.149-14.el7.x86_64 1/1 No '/dev/log' or 'logger' included for syslog logging mknod: '/var/tmp/dracut.0NX0Np/initramfs/dev/kmsg': Operation not permitted mknod: '/var/tmp/dracut.0NX0Np/initramfs/dev/console': Operation not permitted Verifying : kmod-kvdo-6.1.0.149-14.el7.x86_64 1/1 Removed: kmod-kvdo.x86_64 0:6.1.0.149-14.el7 Complete! I now just need to test and confirm that the previous behavior that worked appropriately still does the same.
Proposed fix is to change from:
%preun
rpm -ql kmod-kvdo-%{kmod_driver_version}-%{kmod_rpm_release}%{?dist}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-%{kmod_name}-modules
modprobe -r kvdo
modprobe -r uds
To the following:
%preun
for module in kvdo uds; do
if grep -q ${module} /proc/modules; then
modprobe -r ${module}
fi
done
Ok, testing works as expected on a VM.
Installed successfully:
[vagrant@localhost ~]$ sudo yum install -y kmod-kvdo-6.1.0.149-14.el7.x86_64.rpm
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Examining kmod-kvdo-6.1.0.149-14.el7.x86_64.rpm: kmod-kvdo-6.1.0.149-14.el7.x86_64
Marking kmod-kvdo-6.1.0.149-14.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package kmod-kvdo.x86_64 0:6.1.0.149-14.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================================================
Installing:
kmod-kvdo x86_64 6.1.0.149-14.el7 /kmod-kvdo-6.1.0.149-14.el7.x86_64 1.2 M
Transaction Summary
==============================================================================================================================================================================================================================================
Install 1 Package
Total size: 1.2 M
Installed size: 1.2 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : kmod-kvdo-6.1.0.149-14.el7.x86_64 1/1
Verifying : kmod-kvdo-6.1.0.149-14.el7.x86_64 1/1
Installed:
kmod-kvdo.x86_64 0:6.1.0.149-14.el7
Complete!
Removed successfully with modules not loaded via modprobe:
[vagrant@localhost ~]$ sudo yum remove -y kmod-kvdo
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package kmod-kvdo.x86_64 0:6.1.0.149-14.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================================================
Removing:
kmod-kvdo x86_64 6.1.0.149-14.el7 installed 1.2 M
Transaction Summary
==============================================================================================================================================================================================================================================
Remove 1 Package
Installed size: 1.2 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : kmod-kvdo-6.1.0.149-14.el7.x86_64 1/1
Verifying : kmod-kvdo-6.1.0.149-14.el7.x86_64 1/1
Removed:
kmod-kvdo.x86_64 0:6.1.0.149-14.el7
Complete!
Uninstalls successfully and unloads the modules when able:
[vagrant@localhost ~]$ sudo modprobe kvdo [127/5528]
[vagrant@localhost ~]$ lsmod | egrep 'kvdo|uds'
kvdo 493159 0
uds 270825 1 kvdo
dm_mod 123942 12 kvdo,dm_log,dm_mirror
[vagrant@localhost ~]$ sudo yum remove -y kmod-kvdo
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package kmod-kvdo.x86_64 0:6.1.0.149-14.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================================================
Removing:
kmod-kvdo x86_64 6.1.0.149-14.el7 installed 1.2 M
Transaction Summary
==============================================================================================================================================================================================================================================
Remove 1 Package
Installed size: 1.2 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : kmod-kvdo-6.1.0.149-14.el7.x86_64 1/1
Verifying : kmod-kvdo-6.1.0.149-14.el7.x86_64 1/1
Removed:
kmod-kvdo.x86_64 0:6.1.0.149-14.el7
Complete!
And it also fails to remove (as expected) when the modules are unable to be unloaded (there's a running VDO volume):
[vagrant@localhost ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 64G 0 disk
├─vda1 252:1 0 1G 0 part /boot
└─vda2 252:2 0 63G 0 part
├─rhel_ibm--p8--kvm--03--guest--02-root 253:0 0 41.7G 0 lvm /
├─rhel_ibm--p8--kvm--03--guest--02-swap 253:1 0 1G 0 lvm [SWAP]
└─rhel_ibm--p8--kvm--03--guest--02-home 253:2 0 20.3G 0 lvm /home
vdb 252:16 0 20G 0 disk
[vagrant@localhost ~]$ sudo vdo create --name vdo0 --device /dev/vdb
Creating VDO vdo0
Starting VDO vdo0
Starting compression on VDO vdo0
VDO instance 0 volume is ready at /dev/mapper/vdo0
[vagrant@localhost ~]$ sudo yum remove -y kmod-kvdo
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package kmod-kvdo.x86_64 0:6.1.0.149-14.el7 will be erased
--> Processing Dependency: kmod-kvdo >= 6.1 for package: vdo-6.1.0.149-16.x86_64
--> Running transaction check
---> Package vdo.x86_64 0:6.1.0.149-16 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================================================
Removing:
kmod-kvdo x86_64 6.1.0.149-14.el7 installed 1.2 M
Removing for dependencies:
vdo x86_64 6.1.0.149-16 @rhel-dvd 3.6 M
Transaction Summary
==============================================================================================================================================================================================================================================
Remove 1 Package (+1 Dependent package)
Installed size: 4.8 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Removed symlink /etc/systemd/system/multi-user.target.wants/vdo.service.
Erasing : vdo-6.1.0.149-16.x86_64 1/2
modprobe: FATAL: Module kvdo is in use.
modprobe: FATAL: Module uds is in use.
error: %preun(kmod-kvdo-6.1.0.149-14.el7.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package kmod-kvdo-6.1.0.149-14.el7.x86_64
Verifying : vdo-6.1.0.149-16.x86_64 1/2
Verifying : kmod-kvdo-6.1.0.149-14.el7.x86_64 2/2
Dependency Removed:
vdo.x86_64 0:6.1.0.149-16
Failed:
kmod-kvdo.x86_64 0:6.1.0.149-14.el7
Complete!
I will now be working to submit the changes and get another push available to the 7.5 install and github.
Fixed using the change suggested above *except* the grep string is now "^${module}" to make sure we don't inadvertently match something other than the module we care about.
With version kmod-kvdo-6.1.0.153-15 I am able to uninstall this rpm under chroot now. Found no issues without chroot. xni@ found a wrokaround for this bug, leaving it here in case someone needs it: # rpm -e kmod-kvdo --noscripts 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/RHEA-2018:0900 |