Bug 59494 - %pre scriptlet fails on ro-mounted /usr/share
%pre scriptlet fails on ro-mounted /usr/share
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: scrollkeeper (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Havoc Pennington
:
Depends On: 51193
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-08 17:47 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:
Environment:
Last Closed: 2002-03-01 12:41:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Enrico Scholz 2002-02-08 17:47:25 EST
Description of Problem:

When having /usr/share mounted ro, installation of scrollkeeper fails:

| $ rpm -U /usr/src/redhat/RPMS/i386/scrollkeeper-0.3.4-2.i386.rpm 
| rm: cannot unlink `/usr/share/scrollkeeper/Templates/C/scrollkeeper_cl.xml': Read-only file system
| rm: cannot remove directory `/usr/share/scrollkeeper/Templates/C': Read-only file system
| ...
| error: execution of %pre scriptlet from scrollkeeper-0.3.4-2 failed, exit status 1
| error:   install: %pre scriptlet failed (2), skipping scrollkeeper-0.3.4-2


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

scrollkeeper-0.3.4-2
Comment 1 Jay Turner 2002-02-19 12:28:42 EST
Not quite sure what you are working towards here, but of course the scriptlet
failed.  You have the filesystem mounted RO and the scriptlet is attempting to
remove a directory on /usr/share.  Even is the scriptlet didn't fail, the
install of the package is going to fail, as there are a ton of files that it is
going to try to write to the /usr/share/ filesystem.
Comment 2 Enrico Scholz 2002-02-19 12:42:05 EST
No; the installation itself works and only the scriptlet fails. rpm knows a
%_netsharedpath variable which handles cases where parts of the filesystem are
mounted RO (e.g. because they are shared by NFS). Then files located there will
never be touched by rpm.

Please see bug #51193 for a related discussion.
Comment 3 Havoc Pennington 2002-03-01 12:15:10 EST
I'm not sure how to fix this without ignoring legitimate errors - any suggestions?

i.e. I don't really want to just say "rm foo || true" because it will 
potentially mask real problems.
Comment 4 Enrico Scholz 2002-03-01 12:41:32 EST
You could check if /usr/share/scrollkeeper is writable by you:

| test -w /usr/share/scrollkeeper && {
|   rm -rf ... }

Alternativily to the 'test -w ...' you can use the __isDirectoryShared macro
defined in bug #51193. 

But this may be too much bloat for a simple 'rm -rf'; I can not imagine a
problem which would not be detected in a later stage of rpm. Therefore, keep it
small and simple, and make

| rm -rf /usr/share/scrollkeeper 2>/dev/null || true
Comment 5 Havoc Pennington 2002-03-05 16:32:16 EST
Should be fixed in 0.3.4-3

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