Starting yum from a read-only-mounted home directory thusly fails: % touch foo touch: cannot touch `foo': Read-only file system % sudo yum install gnuchess [...] Total download size: 2.4 M Installed size: 2.4 M Is this ok [y/N]: y Downloading Packages: Setting up and reading Presto delta metadata Processing delta metadata Package(s) data still to download: 2.4 M gnuchess-5.08-1.fc16.x86_64.rpm | 2.4 MB 00:01 Running Transaction Check Running Transaction Test Transaction Test Succeeded Running Transaction gnuchess-5.08-1.fc16.x86_64 was supposed to be installed but is not! Installed: gnuchess.x86_64 0:5.08-1.fc16 Complete! except that the RPM is not actually installed. If one cd's to another local, read-write directory first, things go: % cd /tmp % sudo yum ... [all is well, unicorns are dancing in the clouds, pink ponies for every birthday]
Hi, I'm having problems reproducing it. Tried FC14 and the current git HEAD, not rawhide though. Are you sure that only the CWD was ro? $ dd if=/dev/zero of=bla bs=1M count=50 && mkfs -f bla $ mkdir p && mount -o loop bla p -o ro && cd p $ sudo touch P touch: cannot touch `P': Read-only file system $ sudo yum install gnuchess [unicorns dance]
I have an strace -f yum .... log for the working & non-working cases, but I could find the smoking gun, perhaps because of dbus or whatnot other parties, but I'll attach them. It may matter that it was /home that was itself read-only.
Created attachment 514183 [details] yum run from read-only /home
Created attachment 514186 [details] yum run from read-write /tmp
$ grep ' open(\".\"' strace* strace-ro:5277 open(".", O_RDONLY) = -1 EACCES (Permission denied) strace-ro:5277 open(".", O_RDONLY) = -1 EACCES (Permission denied) strace-rw:5309 open(".", O_RDONLY) = 15 strace-rw:5309 open(".", O_RDONLY) = 8 It's the RPM chroot() thing... lib/rpmchroot.c open()s ".", to fchdir() into it later. This open() surprisingly fails on RO filesystems. It's a RPM bug, and seems mine version (4.8.1) is not affected. I think It's quite easy to fix - just strdup() paths instead of FDs, however I'm not a RPM developer.
Well, I just gave a try- and it works, so it's probably OK to open directories RDONLY on a RO filesystem.. $ touch x touch: cannot touch `x': Read-only file system $ python -c 'import os; print os.open(".", os.O_RDONLY)' 3 Can you try this on your /home? What kind of filesystem is there?
That works the same way here. It's an NFS filesystem mounted ro. selinux is disabled on this machine (VM).
Are we sure this isn't a dup of bug 698795 ?
> That works the same way here. Err, sorry.. Forgot to tell you to try it as root.
sudo python -c 'import os; print os.open(".", os.O_RDONLY)' Traceback (most recent call last): File "<string>", line 1, in <module> OSError: [Errno 13] Permission denied: '.' *** This bug has been marked as a duplicate of bug 698795 ***