Bug 61147 - %post scriptlet fails if /usr/share is mounted ro
Summary: %post scriptlet fails if /usr/share is mounted ro
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: docbook-dtds (Show other bugs)
(Show other bugs)
Version: 7.3
Hardware: i386 Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
Depends On: 51193
TreeView+ depends on / blocked
Reported: 2002-03-14 11:37 UTC by Enrico Scholz
Modified: 2008-05-01 15:38 UTC (History)
0 users

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

Attachments (Terms of Use)

Description Enrico Scholz 2002-03-14 11:37:18 UTC
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 11:42:10 UTC
Don't do that then.  This package's payload contains files in /usr/share too.

Comment 2 Enrico Scholz 2002-03-14 11:45:45 UTC
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 11:48:26 UTC
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 11:54:53 UTC
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 11:58:22 UTC
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 12:12:09 UTC
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 13:26:49 UTC
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.