Bug 79094

Summary: rpm -e silently fails, yet still modifies the db
Product: [Retired] Red Hat Linux Reporter: Chris Ricker <chris.ricker>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DEFERRED QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: barryn
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-12-06 17:27:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Ricker 2002-12-05 16:50:28 UTC
On my servers, I typically have most partitions mounted read-only. On one server
here, I uninstalled a bunch of rpms w/o remembering to remount /usr and /boot r/w.

The rpm commands removed packages from the rpm db, yet left the files on the
system (since the filesystems were mounted read-only), but silently failed to
let me know that packages were failing to uninstall

[root@hanuman root]# rpm -e pine
[root@hanuman root]# rpm -e arpwatch ash
[root@hanuman root]# rpm -e hesiod lha
[root@hanuman root]# rpm -e nasm nss_ldap open pax pdksh postgresql
postgresql-libs postgresql-server                       
warning: /etc/ldap.conf saved as /etc/ldap.conf.rpmsave
/usr/share/info/dir: Read-only file system
error: %preun(nasm-0.98.34-1) scriptlet failed, exit status 1
[root@hanuman root]# mount
/dev/hda6 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/hda1 on /boot type ext3 (ro)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
/dev/hda5 on /tmp type ext3 (rw,noexec,nosuid,nodev)
/dev/hda3 on /usr type ext3 (ro)
[root@hanuman root]# rpm -q pine
package pine is not installed
[root@hanuman root]# /usr/bin/pin<tab>
pine                pinegpg-install     pinky
pine-spellcheck     pinepgpgpg-install  
pinegpg             pinfo               
[root@hanuman root]#             

At a minimum, I'd expect the rpm command to give me some sort of error when it
fails to remove the files....

Comment 1 Jeff Johnson 2002-12-06 17:04:31 UTC
rpm does provide error messages, but only if -vv
is supplied. The rationale is that many packages
don't supply sufficient dependency information
to order sufficiently correctly that a directory
is removed iff empty.

Configure %_netsharedpath if you wannt to use
rpm with R/O mounts. It's not at all clear what
should be done in this case, the current behavior,
removing the package header w/o removing the file
is arguably as good as any other behavior.

Comment 2 Chris Ricker 2002-12-06 17:27:28 UTC
Hmm, let me reword this. The bigger problem here is that the failed rpm -e
commands silently left the system in a completely inconsistent state. rpm -e

* removed the packages from the databases
* removed some of the files from the system for those packages, but not others

Shouldn't rpm be handling rpm -e as a transaction (ie, remove files and rpm
database entries iff both can be done successfully, and if both can't be done,
exit)? Now that rpm has rollback support, this should be possible to implement....

Re-opening as an RFE -- feel free to close if you don't think that makes sense....

Comment 3 Jeff Johnson 2002-12-06 17:30:07 UTC
Sure this is needed, but packaging won't support yet,
hence not bothering the user needlessly with an error message.