Red Hat Bugzilla – Bug 61147
%post scriptlet fails if /usr/share is mounted ro
Last modified: 2008-05-01 11:38:01 EDT
Description of Problem:
When having /usr/share mounted read-only (shared via NFS and added to RPMs
%_netsharedpath; please see bug #51193 also), the %post scriptlet fails:
| $ rpm -U docbook-dtds-1.0-6.noarch.rpm
| could not open /usr/share/sgml/docbook/xmlcatalog for saving
| Fehler: execution of %post scriptlet from docbook-dtds-1.0-6 failed, exit status 2
This corrupts the RPM database because I have now 2 docbook-dtds packages installed:
| $ rpm -q docbook-dtds
Version-Release number of selected component (if applicable):
Don't do that then. This package's payload contains files in /usr/share too.
The NFS-server has installed docbook-dtds and provides the needed files in
/usr/share. Please read bug #51193.
I did; I don't see how this is a package bug. xmlcatalog is "the right way" to
set that file up.
But xmlcatalog writes into a path which must not be touched by a rpm-package.
The FHS names /usr/share as a filesystem also which can be shared between
different hosts and it is obviously that clients should not write there.
The FHS mandates that the file I need to change be under /usr/share. So I guess
Do you have any suggestions for fixing it?
A simple check would be 'test -w ....', e.g.
| if test -w /usr/share/sgml/openjade-1.3.1; then
| for v in 3.0 3.1 4.0 4.1
| /usr/bin/xmlcatalog --sgml --noout --del \
| /etc/sgml/sgml-docbook-$v.cat \
| /usr/share/sgml/openjade-1.3.1/catalog 2>/dev/null
and similarly for the other catalogs. 'test -w ...' fails only if the directory
is not writable. If this is caused by another reason than the %_netsharedpath
RPM would have been failed in the unpacking phase already.
Unfortunately, this solution does not honor the %_netsharedpath itself but works
only if the FS is mounted RO. Therefore, on uninstalling it can happen that
client A removes the catalog-entries on server B and client C does not see them
anymore. To solve this, RPM must provide additional mechanism.
Let me know if 1.0-8 doesn't do the right thing.