Bug 61147 - %post scriptlet fails if /usr/share is mounted ro
%post scriptlet fails if /usr/share is mounted ro
Product: Red Hat Linux
Classification: Retired
Component: docbook-dtds (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Depends On: 51193
  Show dependency treegraph
Reported: 2002-03-14 06:37 EST by Enrico Scholz
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-03-14 07:12:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Enrico Scholz 2002-03-14 06:37:18 EST
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
| docbook-dtds-1.0-2
| docbook-dtds-1.0-6

Version-Release number of selected component (if applicable):

Comment 1 Tim Waugh 2002-03-14 06:42:10 EST
Don't do that then.  This package's payload contains files in /usr/share too.
Comment 2 Enrico Scholz 2002-03-14 06:45:45 EST
The NFS-server has installed docbook-dtds and provides the needed files in
/usr/share. Please read bug #51193.
Comment 3 Tim Waugh 2002-03-14 06:48:26 EST
I did; I don't see how this is a package bug.  xmlcatalog is "the right way" to
set that file up.
Comment 4 Enrico Scholz 2002-03-14 06:54:53 EST
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.
Comment 5 Tim Waugh 2002-03-14 06:58:22 EST
The FHS mandates that the file I need to change be under /usr/share.  So I guess
we're stuck.

Do you have any suggestions for fixing it?
Comment 6 Enrico Scholz 2002-03-14 07:12:09 EST
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
|   do
|                /usr/bin/xmlcatalog --sgml --noout --del \
|                         /etc/sgml/sgml-docbook-$v.cat \
|                         /usr/share/sgml/openjade-1.3.1/catalog 2>/dev/null
|         fi
|   done
| fi

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.
Comment 7 Tim Waugh 2002-03-14 08:26:49 EST
Let me know if 1.0-8 doesn't do the right thing.

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