Bug 50670 - scriptlets fail if /var/ftp is mounted ro
Summary: scriptlets fail if /var/ftp is mounted ro
Keywords:
Status: CLOSED DUPLICATE of bug 52190
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On: 51193
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-01 22:53 UTC by Enrico Scholz
Modified: 2007-04-18 16:35 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-08-09 15:29:40 UTC
Embargoed:


Attachments (Terms of Use)

Description Enrico Scholz 2001-08-01 22:53:14 UTC
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:

everytime


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
Berechtigung
cp: Entfernen von ;/var/ftp/lib/libnsl-2.2.3.so+ nicht mvglich: Keine
Berechtigung
cp: Entfernen von ;/var/ftp/lib/libnss_files-2.2.3.so+ nicht mvglich: Keine
Berechtigung
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 17:23:58 UTC
If /var/ftp is mounted ro, anonftp can't work by design.
A

%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!"
fi

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 18:00:34 UTC
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 15:29:35 UTC
Changing package to rpm

Comment 4 Jeff Johnson 2001-08-30 18:06:32 UTC
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.