On 07/16/2012 12:20 PM, Roger Leigh wrote:
> The question I have is, is this reproducible without schroot.
> e.g. can you reproduce the problem by:
> - mounting linprocfs on /path/to/chroot/proc
> - running "chroot /path/to/chroot"
> - testing if it still fails
> 
> If this is the case, then it's most likely a linprocfs bug in
> the kfreebsd kernel.
> 
> Also, what happens if you do a nullfs mount of the host /proc
> onto /path/to/chroot?  Does it still fail in this case?

I'd treat them as two different issues, even though tests make me point
the finger at nullfs in both cases. Don't know if two symptoms of the
same bug.

------------
kernel issue
------------

Some tests with getpathname I attached in first mail.

prepare
 # mkdir /tmp/subdir
 # cp getpathname /tmp
 # cp getpathname /tmp/subdir
 # cp getpathname /usr
 # cp getpathname /usr/local

 # cd /tmp
 # ./getpathname
 /tmp/getpathname
 # /tmp/getpathname
 /tmp/getpathname
 # cd /
 # /tmp/getpathname
 /tmp/getpathname

 # cd /tmp/subdir
=== schroot
 # ./getpathname
 /tmp/subdir/getpathname
 # /tmp/subdir/getpathname
 /tmp/subdir/getpathname
 # cd /tmp
 # /tmp/subdir/getpathname
 sysctl error           <<<<<
 # cd /
 # /tmp/subdir/getpathname
 sysctl error           <<<<<
=== classic chroot
 # ./getpathname
 /tmp/subdir/getpathname
 # /tmp/subdir/getpathname
 /tmp/subdir/getpathname
 # cd /tmp
 # /tmp/subdir/getpathname
 /tmp/subdir/getpathname
 # cd /
 # /tmp/subdir/getpathname
 /tmp/subdir/getpathname
=== classic chroot with /tmp nullfs
 # ./getpathname
 /tmp/subdir/getpathname
 # /tmp/subdir/getpathname
 /tmp/subdir/getpathname
 # cd /tmp
 # /tmp/subdir/getpathname
 sysctl error           <<<<<
 # cd /
 # /tmp/subdir/getpathname
 sysctl error           <<<<<

 # cd /usr
 # ./getpathname
 /usr/getpathname
 # /usr/getpathname
 /usr/getpathname
 # cd /
=== schroot
 # /usr/getpathname
 sysctl error           <<<<<
=== classic chroot
 # /usr/getpathname
 /usr/getpathname
=== classic chroot with /usr nullfs
 # /usr/getpathname
 /usr/getpathname

 # cd /usr/local
=== schroot
 # ./getpathname
 sysctl error           <<<<<
 # /usr/local/getpathname
 sysctl error           <<<<<
 # cd /usr
 # /usr/local/getpathname
 sysctl error           <<<<<
 # cd /
 # /usr/local/getpathname
 sysctl error           <<<<<
=== classic chroot
 # ./getpathname
 /usr/local/getpathname
 # /usr/local/getpathname
 /usr/local/getpathname
 # cd /usr
 # /usr/local/getpathname
 /usr/local/getpathname
 # cd /
 # /usr/local/getpathname
 /usr/local/getpathname
=== classic chroot with /usr nullfs
 # ./getpathname
 /usr/local/getpathname
 # /usr/local/getpathname
 /usr/local/getpathname
 # cd /usr
 # /usr/local/getpathname
 sysctl error           <<<<<
 # cd /
 # /usr/local/getpathname
 sysctl error           <<<<<

--------------------
/proc/self/exe issue
--------------------

# mount -t linprocfs proc /srv/chroot/unstable-kfreebsd-i386-sbuild/proc
# chroot /srv/chroot/unstable-kfreebsd-i386-sbuild ls -l /proc/self/exe
lr--r--r-- 1 root root 0 Jul 16 13:17 /proc/self/exe -> /bin/ls
(unstable-kfreebsd-i386-sbuild)root@kfreebsd-i386-01:/# exit
# umount /srv/chroot/unstable-kfreebsd-i386-sbuild/proc

# mount -t nullfs /proc /srv/chroot/unstable-kfreebsd-i386-sbuild/proc
# chroot /srv/chroot/unstable-kfreebsd-i386-sbuild ls -l /proc/self/exe
lr--r--r-- 1 root root 0 Jul 16 13:18 /proc/self/exe -> /bin/ls
# umount /srv/chroot/unstable-kfreebsd-i386-sbuild/proc

# schroot -c sid -- ls -l /proc/self/exe
ls: cannot read symbolic link /proc/self/exe: No such file or directory
lr--r--r-- 1 root root 0 Jul 16 13:24 /proc/self/exe

Symbolic link which doesn't point to any file.
Seems the underlying nullfs breaks linprocfs overmount.



-- 
Gabriele


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to