Bug 50670

Summary: scriptlets fail if /var/ftp is mounted ro
Product: [Retired] Red Hat Linux Reporter: Enrico Scholz <rh-bugzilla>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-08-09 15:29:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 51193    
Bug Blocks:    

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 ***