Rogue NFS mount, chflags problem during installworld

Dmitry Marakasov amdmi3 at amdmi3.ru
Tue Feb 3 11:36:57 EST 2009


Hi!

I've just upgraded by tinderbox to CVS. Great improvement from the last
time I've updated it, but nevertheless I've encountered some bugs.

First, when a port fails to build, `tc resetBuild` tries to do some NFS
mount (and hangs in my case), althrough I've set tinderbox up for
nullfs usage. Here's pstree for it:

-+- 82773 root /bin/sh -T /tinderbox/scripts/tinderd2
 |-+- 18806 root /bin/sh /tinderbox/scripts/tc tinderbuild -b 8.0-FreeBSD-amd64 devel/simgear
 | \-+- 30204 root make PACKAGES=/tinderbox/packages/8.0-FreeBSD-amd64 -k -j1 all
 |   \-+- 33663 root sh -ev
 |     \-+- 33664 root /bin/sh /tinderbox/scripts/lib/portbuild 8.0-FreeBSD-amd64 8.0-amd64 FreeBSD cmake-2.6.2.tbz /usr/ports/devel/cmake
 |       \-+- 27412 root /bin/sh /tinderbox/scripts/tc resetBuild -b 8.0-FreeBSD-amd64
 |         \-+- 27971 root mount -o nfsv3,intr,tcp -o ro localhost://tinderbox/portstrees/FreeBSD/ports /tinderbox/8.0-FreeBSD-amd64/a/ports
 |           \--- 27972 root mount_nfs -o nfsv3 -o intr -o tcp -o ro localhost://tinderbox/portstrees/FreeBSD/ports /tinderbox/8.0-FreeBSD-amd64/a/ports
 |--- 28708 root sleep 30
 \-+- 74745 root /bin/sh /tinderbox/scripts/tc tinderbuild -b 7.1-FreeBSD-i386 devel/simgear
   \-+- 76179 root make PACKAGES=/tinderbox/packages/7.1-FreeBSD-i386 -k -j1 all
     \-+- 48302 root sh -ev
       \-+- 48303 root /bin/sh /tinderbox/scripts/lib/portbuild 7.1-FreeBSD-i386 7.1-i386 FreeBSD boost-1.34.1.tbz /usr/ports/devel/boost
         \-+- 26182 root /bin/sh /tinderbox/scripts/tc resetBuild -b 7.1-FreeBSD-i386
           \-+- 26945 root mount -o nfsv3,intr,tcp -o ro localhost://tinderbox/portstrees/FreeBSD/ports /tinderbox/7.1-FreeBSD-i386/a/ports
             \--- 26946 root mount_nfs -o nfsv3 -o intr -o tcp -o ro localhost://tinderbox/portstrees/FreeBSD/ports /tinderbox/7.1-FreeBSD-i386/a/ports

Also, I've experienced troubles with installing world when building
the jail. It failed because of `chflags: operation not permitted'
when installing libc.so. I'm not sure what's the cause, actually my
installation is quite complex, I run tinderbox in a jail
(/usr/jails/tinderbox) which is located on ZFS, and filesystem for
tinderbox is plain UFS mounted with -oasync to
/usr/jails/tinderbox/tinderbox. lighthttpd and mysql are ran in the
jail, but tinderd runs in a plain chroot to the same location (as
there's problem mounting filesystems from a jail).

Anyway, the only cause I see for chflags to fail is that it's being ran
inside a chroot. I've modified lib/tc_command.sh like this:

--- lib/tc_command.sh   11 Jan 2009 22:19:16 -0000      1.115
+++ lib/tc_command.sh   3 Feb 2009 16:08:47 -0000
@@ -690,12 +690,12 @@
     echo "${jailName}: making world"
 
     # determine if we're cross-building world
-    crossEnv=""
+    crossEnv="NO_FSCHG=yes"
     if [ "${jailArch}" != "${myArch}" ]; then
-       crossEnv="TARGET_ARCH=${jailArch}"
+       crossEnv="${crossEnv} TARGET_ARCH=${jailArch}"
     fi
     cd ${SRCBASE} && env DESTDIR=${J_TMPDIR} ${crossEnv} \
-       make world > ${jailBase}/world.tmp 2>&1
+       make -j3 world > ${jailBase}/world.tmp 2>&1
     rc=$?
     execute_hook "postJailBuild" "JAIL=${jailName} DESTDIR=${J_TMPDIR} JAIL_ARCH=${jailArch} MY_ARCH=${myArch} JAIL_OBJDIR=${JAIL_OBJDIR} SRCBASE=${SRCBASE} PB=${pb} RC=${rc}"
     if [ ${rc} -ne 0 ]; then

I think it would be useful in general, as it makes jail removal by hand
easier (no need for chflags -R noschg before rm -rf) and lessens
requirements to filesystem and environment (chroot/jail/zfs/...).

Another change is -j 3 for buildworld, it was mentioned already on the
list (and should be done correctly with `sysctl -n kern.smp.cpus`+1
value instead of 3)

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3 at amdmi3.ru  ..:  jabber: amdmi3 at jabber.ru    http://www.amdmi3.ru


More information about the tinderbox-list mailing list