Description of Problem: rpm fails to install a file (e.g. /dev/initctl with mounted devfs), ceases to install the rest of the files but doesn't complain to the user, see Bug #50040 for more information.
Forgot to mention that it's rpm-4.0.3-0.82.
Hmmm /dev/initctl is not just a file, it's a named pipe created when init is started ...
Of course it is -- but being in /dev, it should not be contained in SysVinit but in dev (to avoid putting devfs-workarounds in more packages than necessary). The point for RPM is that it failed to unpack/mknod /dev/initctl (so far so good) and failed to unpack the rest of the files _silently_, without any hints that something has failed, thus the data in the RPM db differs from what's actually installed on the system and an admin thinking (s)he has installed a new version of SysVinit when in fact the old one is still used.
(please bear with my wrong grammar in the last sentence) Other examples where RPM might fail in this case: - badly configured RPM (no netsharedpath) and files lying on R/O NFS - bad H4X0Rs making files immutable (this is the point where you really want to be sure whether you've installed the unencumbered package successfully)
Yes, I understand all that, and will look. I strongly question, however, whether a named pipe that is usually removed and recreated when a daemon is restarted should be in packaging at all, there's very little gain to be had. I expect to find, when I dig in, that there are side effects to wrting to a named pipe ... And, yes, rpm's netsharedpath is naive. I've been asking for suggestions for a more robust mechanism for years, and, so far, have recieved nothing positive, only complaints. And, again, rpm has not a clue about immutable bits, and teaching rpm about immutable files leads to a lot of portability madness. Finally, you've forgotten the equally important problem that rpm has little clue about rdonly mounts.
> I strongly question, however, whether a named pipe that is usually removed > and recreated when a daemon is restarted should be in packaging at all, > there's very little gain to be had. Exactly my opinion. > And, yes, rpm's netsharedpath is naive. I've been asking for suggestions > for a more robust mechanism for years, and, so far, have recieved nothing > positive, only complaints. OK, so here a positive comment: For years, I used the netsharedpath feature to serve /usr/doc and the like from one server to a pool of clients and I haven't had any problems with it (except when I configured the netsharedpath incorrectly or not at all). > And, again, rpm has not a clue about immutable bits, and teaching > rpm about immutable files leads to a lot of portability madness. > > Finally, you've forgotten the equally important problem that rpm has little > clue about rdonly mounts. My point was only that RPM should report that a package wasn't installed correctly when that's the case, it should go like this: 1. File /x/y/z can't be written for whatever reason. 2. The remaining files won't get installed. 3. rpm complains to the user "Couldn't be installed due to blah blah ...". Currently it doesn't report anything so you might think that a package is installed properly when it fact it isn't. I don't ask you to put some AI into rpm to handle named pipes, r/o dirs and the like the way the administrator wants to (because that isn't the scope of rpm), I just want to see that it's failed when it's failed.
SysVinit-2.78-18 installs fine without mounted devfs. If mounted devfs is a problem, then you need to deal with that case in the SysVinit package by 1) testing for mounted devfs in %pre and failing to install if found. 2) taking /dev/initctl out of the package, possibly leaving a %ghost entry and doing your own mknod.
Umm, maybe I expressed myself not that clearly, I try it again: The problem is that RPM failed to install a package properly but appeared to have it installed correctly. In my case, it _looked_ like the SysVinit package was installed properly, but in fact a number of files where those of the previously installed version. It should have told me something along the lines of: "Failed to unpack file /dev/initctl, aborting" instead of "SysVinit: ###...### [100%]".
No you are expressing yourself clearly, but you are not understanding that I'm not going to do anything in rpm about a named pipe not installing with devfs mounted. Fix the package in the manner described.
You didn't read all I wrote, did you (and no, you didn't understand me either)? This symptom doesn't only show with a named pipe not installing on devfs, but in other cases as well: - File inadvertently left chattr +i (or made that way by "visitors") - bad blocks on a disk - netshared path configured bogus The symptom is (please read carefully): - RPM fails on a file (for whatever reason, so far so good) - RPM skips that file and all following (still ok) - RPM does so without giving notice to the user who thinks that everything went smoothly. <--- This is what should be fixed. Again: RPM should at least tell the user "package not installed properly" and give a non-zero error code (maybe it does the last, I didn't check). To illustrate this, I set /etc/redhat-release immutable to simulate a file sitting on bad blocks or whatever else. RPM didn't tell me that it just skipped installing nearly the whole package (see all the missing files on "rpm -V") -- it's your turn: ----- 8< ----- [root@cognac RPMS]# rpm -q redhat-release redhat-release-7.1.92-1 [root@cognac RPMS]# rpm -ql redhat-release /etc/redhat-release /usr/share/doc/redhat-release-7.1.92 /usr/share/doc/redhat-release-7.1.92/COPYING /usr/share/doc/redhat-release-7.1.92/README-alpha /usr/share/doc/redhat-release-7.1.92/README-i386 /usr/share/doc/redhat-release-7.1.92/README-ia64 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-alpha /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386.de /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386.es /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386.fr /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386.it /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386.ja /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-ia64 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-ia64.de /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-ia64.fr /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-ia64.ja /usr/share/doc/redhat-release-7.1.92/RPM-GPG-KEY /usr/share/doc/redhat-release-7.1.92/announcement /usr/share/doc/redhat-release-7.1.92/autorun-template [root@cognac RPMS]# chattr +i /etc/redhat-release [root@cognac RPMS]# rpm -Uvh redhat-release-7.1.93-1.noarch.rpm Preparing... ########################################### [100%] 1:redhat-release warning: /etc/issue created as /etc/issue.rpmnew warning: /etc/issue.net created as /etc/issue.net.rpmnew ########################################### [100%] [root@cognac RPMS]# rpm -V redhat-release ..5....T /etc/redhat-release missing /usr/share/doc/redhat-release-7.1.93 missing /usr/share/doc/redhat-release-7.1.93/COPYING missing /usr/share/doc/redhat-release-7.1.93/README-i386 missing /usr/share/doc/redhat-release-7.1.93/README-ia64 missing /usr/share/doc/redhat-release-7.1.93/RELEASE-NOTES-i386 missing /usr/share/doc/redhat-release-7.1.93/RELEASE-NOTES-ia64 missing /usr/share/doc/redhat-release-7.1.93/RPM-GPG-KEY missing /usr/share/doc/redhat-release-7.1.93/autorun-template----- >8 -----
There is (and never has been) support for chattr in rpm. bad blocks on disk are a hardware problem, fix your disk Configuration using netsharedpath is up to the sysadmin. How is rpm supposed to detect a netsharedpath misconfiguration?
[ Slowly this gets some kind of a Kafkaesque touch ] You misunderstand me completely. I DON'T (sorry for screaming) want tricky support for named pipes, extended attributes or even bad blocks in RPM. What I want is something we already had in older versions of RPM: If the unpacking of the files fails (the reason is unimportant), RPM has (in the past) failed as well with something along the lines of "cpio: unpacking failed on file /foo/bar/baz". I (and everyone else I asked) want this or a similar behavior back. I DON'T want RPM to be smart about handling such errors, but I want it to give me notice so that I can (capability assumed) be smart about it. At the moment, I don't have the chance to fix such an error when it occurs, except if I verify the package by chance. Your turn.
rpm really should rollback if the unpack of one of the files fails. whatever the reason is. _And_ the exit status should be != 0 This defect is considered SHOULD-FIX for Fairfax. ;o)
Agreed Kafkaesque. Exactly the same mechanism to report failures, with exactly the same error codes (well, I added 1 more code), is AFAIK reported in the same error situations. If anything, having rewritten the unpacking code as a state machine, there error reporting should be better. However, you are using non-supported functionality like devfs and chattr, with baroque oddities like named pipes, as well as known deficiencies like netsharedpath, or impossible to reproduce problems like bad blocks to illustrate your request..
Hmm, it should report the error but it doesn't :-(. To make it absolutely clear: I used devfs/named pipe or the immutable file only as a way to illustrate the problem: - File cannot be written (makes no difference why) - RPM does not report the error and fails without the smallest hint that it didn't install the package properly I think everyone agrees that RPM should report it visibly to the user/the calling process (i.e. error code _and_ error text) when it can't install even one of the files contained in a package. At the moment it doesn't. In the past it did. Just try it out and tell me whether this is proper functioning (this time with increased verbosity -- and don't complain about chattr +i, this is only one way where a file can't be written into): --- 8< --- [root@cognac RPMS]# rpm -q redhat-release redhat-release-7.1.92-1 [root@cognac RPMS]# chattr +i /etc/redhat-release [root@cognac RPMS]# rpm -Uvvh /mnt/beehive/comps/dist/7.2/redhat-release/7.1.93-1/ SRPMS noarch tests [root@cognac RPMS]# rpm -Uvvh /mnt/beehive/comps/dist/7.2/redhat-release/7.1.93-1/noarch/redhat-release-7.1.93-1.noarch.rpm D: ============== /mnt/beehive/comps/dist/7.2/redhat-release/7.1.93-1/noarch/redhat-release-7.1.93-1.noarch.rpm D: Expected size: 17266 = lead(96)+sigs(160)+pad(0)+data(17010) D: Actual size: 17266 D: opening db environment /var/lib/rpm/Packages create:mpool D: opening db index /var/lib/rpm/Packages create mode=0x42D: locked db index /var/lib/rpm/Packages D: opening db environment /var/lib/rpm/Name joinenv D: opening db index /var/lib/rpm/Name create mode=0x42 D: added binary package [0] D: found 0 source and 1 binary packages D: ========== +++ redhat-release-7.1.93-1 D: opening db index /var/lib/rpm/Depends create mode=0x42 D: opening db environment /var/lib/rpm/Basenames joinenv D: opening db index /var/lib/rpm/Basenames create mode=0x42 D: Requires: /bin/sh YES (db files) D: NO A rpmlib(PayloadFilesHavePrefix) <= 4.0-1 B rpmlib(VersionedDependencies) = 3.0.3-1 D: NO A rpmlib(PayloadFilesHavePrefix) <= 4.0-1 B rpmlib(CompressedFileNames) = 3.0.4-1 D: NO A rpmlib(PayloadFilesHavePrefix) <= 4.0-1 B rpmlib(PayloadIsBzip2) = 3.0.5-1 D: YES A rpmlib(PayloadFilesHavePrefix) <= 4.0-1 B rpmlib(PayloadFilesHavePrefix) = 4.0-1 D: Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 YES (rpmlib provides) D: NO A rpmlib(CompressedFileNames) <= 3.0.4-1 B rpmlib(VersionedDependencies) = 3.0.3-1 D: YES A rpmlib(CompressedFileNames) <= 3.0.4-1 B rpmlib(CompressedFileN ames) = 3.0.4-1 D: Requires: rpmlib(CompressedFileNames) <= 3.0.4-1 YES (rpmlib provides) D: Requires: R /bin/sh YES (cached) D: opening db environment /var/lib/rpm/Conflictname joinenv D: opening db index /var/lib/rpm/Conflictname create mode=0x42 D: ========== --- redhat-release-7.1.92-1 D: opening db environment /var/lib/rpm/Requirename joinenv D: opening db index /var/lib/rpm/Requirename create mode=0x42 D: Requires: /etc/redhat-release YES (added files) D: ========== recording tsort relations D: ========== tsorting packages (order, #predecessors, #succesors, depth) D: 0 0 1 0 redhat-release-7.1.93-1 D: installing binary packages D: getting list of mounted filesystems D: opening db environment /var/lib/rpm/Group joinenv D: opening db index /var/lib/rpm/Group create mode=0x42 D: opening db environment /var/lib/rpm/Providename joinenv D: opening db index /var/lib/rpm/Providename create mode=0x42 D: opening db environment /var/lib/rpm/Triggername joinenv D: opening db index /var/lib/rpm/Triggername create mode=0x42 D: opening db environment /var/lib/rpm/Dirnames joinenv D: opening db index /var/lib/rpm/Dirnames create mode=0x42 D: opening db environment /var/lib/rpm/Requireversion joinenv D: opening db index /var/lib/rpm/Requireversion create mode=0x42 D: opening db environment /var/lib/rpm/Provideversion joinenv D: opening db index /var/lib/rpm/Provideversion create mode=0x42 D: opening db environment /var/lib/rpm/Installtid joinenv D: opening db index /var/lib/rpm/Installtid create mode=0x42 D: opening db environment /var/lib/rpm/Removetid joinenv D: opening db index /var/lib/rpm/Removetid create mode=0x42 Preparing... ########################################### [100%] D: Expected size: 17266 = lead(96)+sigs(160)+pad(0)+data(17010) D: Actual size: 17266 D: install: redhat-release-7.1.93-1 has 11 files, test = 0 D: install: running %pre script(s) (if any) D: ========= Directories not explictly included in package: D: 0 /etc/ D: 1 /usr/share/doc/ D: ========= 1:redhat-release D: fini 100644 1 ( 0, 0) 67 /etc/issue;3b680322 D: fini 100644 1 ( 0, 0) 66 /etc/issue.net;3b680322 D: fini 100644 1 ( 0, 0) 47 /etc/redhat-release;3b680322 GZDIO: 1 reads, 8192 total bytes in 0.001 secs ########################################### [100%] D: +++ 1226 redhat-release-7.1.93-1 D: adding "redhat-release" to Name index. D: adding 11 entries to Basenames index. D: adding "System Environment/Base" to Group index. D: adding 4 entries to Requirename index. D: adding 1 entries to Providename index. D: adding 1 entries to Triggername index. D: adding 3 entries to Dirnames index. D: adding 4 entries to Requireversion index. D: adding 1 entries to Provideversion index. D: adding 1 entries to Installtid index. D: install: running %post script(s) (if any) D: erase: redhat-release-7.1.92-1 has 22 files, test = 0 D: erase: running %preun script(s) (if any) D: fini 100755 1 ( 0, 0) 538 /usr/share/doc/redhat-release-7.1.92/autorun-template D: fini 100644 1 ( 0, 0) 7080 /usr/share/doc/redhat-release-7.1.92/announcement D: fini 100644 1 ( 0, 0) 1908 /usr/share/doc/redhat-release-7.1.92/RPM-GPG-KEY D: fini 100644 1 ( 0, 0) 15100 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-ia64.ja D: fini 100644 1 ( 0, 0) 18007 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-ia64.fr D: fini 100644 1 ( 0, 0) 17404 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-ia64.de D: fini 100644 1 ( 0, 0) 5172 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-ia64 D: fini 100644 1 ( 0, 0) 18811 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386.ja D: fini 100644 1 ( 0, 0) 21012 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386.it D: fini 100644 1 ( 0, 0) 22542 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386.fr D: fini 100644 1 ( 0, 0) 21654 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386.es D: fini 100644 1 ( 0, 0) 21942 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386.de D: fini 100644 1 ( 0, 0) 5865 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-i386 D: fini 100644 1 ( 0, 0) 19551 /usr/share/doc/redhat-release-7.1.92/RELEASE-NOTES-alpha D: fini 100644 1 ( 0, 0) 3420 /usr/share/doc/redhat-release-7.1.92/README-ia64 D: fini 100644 1 ( 0, 0) 4267 /usr/share/doc/redhat-release-7.1.92/README-i386 D: fini 100644 1 ( 0, 0) 3574 /usr/share/doc/redhat-release-7.1.92/README-alpha D: fini 100644 1 ( 0, 0) 18385 /usr/share/doc/redhat-release-7.1.92/COPYING D: fini 040755 2 ( 0, 0) 4096 /usr/share/doc/redhat-release-7.1.92 D: fini 100644 1 ( 0, 0) 47 /etc/redhat-release skip D: fini 100644 1 ( 0, 0) 66 /etc/issue.net skip D: fini 100644 1 ( 0, 0) 67 /etc/issue skip D: erase: running %postun script(s) (if any) D: YES A redhat-release = 7.1.92-1 B redhat-release < 7.1.93-1 + '[' -f /etc/issue.rpmnew ']' + '[' -f /etc/issue.net.rpmnew ']' D: --- 1225 redhat-release-7.1.92-1 D: removing "redhat-release" from Name index. D: removing 22 entries from Basenames index. D: removing "System Environment/Base" from Group index. D: removing 3 entries from Requirename index. D: removing 1 entries from Providename index. D: removing 3 entries from Dirnames index. D: removing 3 entries from Requireversion index. D: removing 1 entries from Provideversion index. D: removing 1 entries from Installtid index. D: closed db index /var/lib/rpm/Depends D: closed db index /var/lib/rpm/Removetid D: closed db environment /var/lib/rpm/Removetid D: removed db environment /var/lib/rpm/Removetid D: verified db index /var/lib/rpm/Removetid D: closed db index /var/lib/rpm/Installtid D: closed db environment /var/lib/rpm/Installtid D: removed db environment /var/lib/rpm/Installtid D: verified db index /var/lib/rpm/Installtid D: closed db index /var/lib/rpm/Provideversion D: closed db environment /var/lib/rpm/Provideversion D: removed db environment /var/lib/rpm/Provideversion D: verified db index /var/lib/rpm/Provideversion D: closed db index /var/lib/rpm/Requireversion D: closed db environment /var/lib/rpm/Requireversion D: removed db environment /var/lib/rpm/Requireversion D: verified db index /var/lib/rpm/Requireversion D: closed db index /var/lib/rpm/Dirnames D: closed db environment /var/lib/rpm/Dirnames D: removed db environment /var/lib/rpm/Dirnames D: verified db index /var/lib/rpm/Dirnames D: closed db index /var/lib/rpm/Triggername D: closed db environment /var/lib/rpm/TriggernameD: removed db environment /var/lib/rpm/Triggername D: verified db index /var/lib/rpm/Triggername D: closed db index /var/lib/rpm/Conflictname D: closed db environment /var/lib/rpm/Conflictname D: removed db environment /var/lib/rpm/Conflictname D: verified db index /var/lib/rpm/Conflictname D: closed db index /var/lib/rpm/Providename D: closed db environment /var/lib/rpm/Providename D: removed db environment /var/lib/rpm/Providename D: verified db index /var/lib/rpm/Providename D: closed db index /var/lib/rpm/Requirename D: closed db environment /var/lib/rpm/Requirename D: removed db environment /var/lib/rpm/Requirename D: verified db index /var/lib/rpm/Requirename D: closed db index /var/lib/rpm/Group D: closed db environment /var/lib/rpm/Group D: removed db environment /var/lib/rpm/Group D: verified db index /var/lib/rpm/Group D: closed db index /var/lib/rpm/Basenames D: closed db environment /var/lib/rpm/Basenames D: removed db environment /var/lib/rpm/Basenames D: verified db index /var/lib/rpm/Basenames D: closed db index /var/lib/rpm/Name D: closed db environment /var/lib/rpm/Name D: removed db environment /var/lib/rpm/Name D: verified db index /var/lib/rpm/Name D: closed db index /var/lib/rpm/Packages D: closed db environment /var/lib/rpm/Packages D: removed db environment /var/lib/rpm/Packages D: verified db index /var/lib/rpm/Packages [root@cognac RPMS]# rpm -V redhat-release ..5....T /etc/redhat-release missing /usr/share/doc/redhat-release-7.1.93 missing /usr/share/doc/redhat-release-7.1.93/COPYING missing /usr/share/doc/redhat-release-7.1.93/README-i386 missing /usr/share/doc/redhat-release-7.1.93/README-ia64 missing /usr/share/doc/redhat-release-7.1.93/RELEASE-NOTES-i386 missing /usr/share/doc/redhat-release-7.1.93/RELEASE-NOTES-ia64 missing /usr/share/doc/redhat-release-7.1.93/RPM-GPG-KEY missing /usr/share/doc/redhat-release-7.1.93/autorun-template --- >8 ---
There's no such thing as "proper functioning" when it comes to rpm, only preserving legacy behavior. rpm is supposed to guarantee all-or-nothing semantics when installing a transaction set, but, in fact, rpm has never guaranteed this. <shrug> There are several other bugs against rpm that report variants of the same problem your are harping on. See #21881 for a variant of the same lack of guarantee having to do with script execution failure rather than file install failure. See also #11247 for a chattr failure. I *know* these problems already. What is in progress is implementing that guarantee, and, in addition, using a full-blown --apply transaction/packages/files installed with temp names --commit transaction/package/files renamed into place --undo undo an applied transaction/package/file. --rollback undo a committed transaction/package/file. Now leave the problem alone, please, as I have other, more important problems, that I need to work on. I suspect you too have much better things to do than bash on rpm as well.