Bug 50670 - scriptlets fail if /var/ftp is mounted ro
scriptlets fail if /var/ftp is mounted ro
Status: CLOSED DUPLICATE of bug 52190
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
Depends On: 51193
  Show dependency treegraph
Reported: 2001-08-01 18:53 EDT by Enrico Scholz
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-08-09 11:29:40 EDT
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 2001-08-01 18:53:14 EDT
Description of Problem:

When having /var/ftp mounted read-only and put into rpm's %_netsharedpath,
the %trigger scripts fail.

I suggest to test if /var/ftp can be written before executing them;
probably there is new rpm-functionality needed.

How Reproducible:


Steps to Reproduce:
1. echo '%_netsharedpath /var/ftp' >/etc/rpm/macros
2. mount -o remount,ro /var/ftp
3. rpm -i anonftp-4.0-6
4. rpm -U glibc-<a newer version>

Actual Results:

(4) [sorry for German messages; they are telling there is no permission to
delete the files or change the file-mode]
cp: Entfernen von ;/var/ftp/lib/ld-2.2.3.so+ nicht mvglich: Keine Berechtigung
cp: Entfernen von ;/var/ftp/lib/libc-2.2.3.so+ nicht mvglich: Keine
cp: Entfernen von ;/var/ftp/lib/libnsl-2.2.3.so+ nicht mvglich: Keine
cp: Entfernen von ;/var/ftp/lib/libnss_files-2.2.3.so+ nicht mvglich: Keine
chmod: Beim Setzen der Zugriffsrechte f|r ;/var/ftp/lib/libs.md5+: Die
Operation ist nicht erlaubt
/sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~:
Permission denied
Fehler: execution of %trigger scriptlet from anonftp-4.0-6 failed, exit
status 1

Expected Results:

no error messages
Comment 1 Bernhard Rosenkraenzer 2001-08-08 13:23:58 EDT
If /var/ftp is mounted ro, anonftp can't work by design.

%trigger foo
if ! touch /var/ftp/test; then
	echo "Trigger couldn't execute, please clean up the mess manually"
	echo "because this script can't be rerun!"

wouldn't be very nice either - especially not if you're using kpackage or 
gnorpm (and therefore don't see the output of trigger messages).

If you have any idea what should be done in this case (without having to change 
rpm), let me know.
I think for now, assuming /var/anything is writable [that's what /var is there 
for, anyway] is safe.

Comment 2 Enrico Scholz 2001-08-08 14:00:34 EDT
Why must /var/ftp be mounted rw? 

Yes, I have tested it locally and it works. /var/ftp is NFS-mounted from another
host which executed the trigger-script successfully. Thus, all the needed files
are there and "the mess" was cleaned up already.

Perhaps you are asking for the reasons why I am doing such crazy thing:
I have mounted /var/ftp (+ /var/www) locally because the usual
filesystem-functions are more comfortable than ftp-clients or www-browser. 

If you do not trust into wu-ftpd's robustness, it may be advantageously to
prohibit writing in /var/ftp on the file-system layer already.

In bug #51193 I have asked for a general way to respect %_netsharedpath. I have
not got an answer, but I gave a (more or less dirty) %__isDirectoryShared macro
which can be used as:

| %post
| %__isDirectoryShared /var/ftp && exit 0
| # ... the old stuff ...

Comment 3 Jeff Johnson 2001-08-09 11:29:35 EDT
Changing package to rpm
Comment 4 Jeff Johnson 2001-08-30 14:06:32 EDT
Collapsing RO mount problems at #52190.

*** This bug has been marked as a duplicate of 52190 ***

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