Subject: pkg/21087: bulk builds in a sandbox created by mksandbox are missing files
To: None <>
From: None <>
List: netbsd-bugs
Date: 04/10/2003 10:29:43
>Number:         21087
>Category:       pkg
>Synopsis:       bulk builds in a sandbox created by mksandbox are missing files
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 10 09:30:00 PDT 2003
>Release:        NetBSD 1.6
Brook G. Milligan                      Internet:
Department of Biology
New Mexico State University            Telephone:  (505) 646-7980
Las Cruces, New Mexico  88003  U.S.A.  FAX:        (505) 646-5665
System: NetBSD 1.6 NetBSD 1.6 (GENERIC_LAPTOP) #0: Sun Sep 8 19:55:58 UTC 2002 i386
Architecture: i386
Machine: i386
	While chrooted sandboxes are great for containing bulk builds
so they don't affect the live system, to be useful they need to
reflect the minimum necessary subset of a live system.  In this case,
there are two elements that are missing from the subset constructed by
mksandbox.  The first is /var/spool/mqueue, which is required for the
bulk build process to queue its report for mailing.  The second is
that some packages (e.g., at least x11/kdebase) specifically test for
/var/run/utmp in order to add capabilities during compilation.  This
is part of the live system, so it seems this test should be successful
within the chroot environment.
	1. create a sandbox using mksandbox
	2. chroot to the sandbox
	3. launch a bulk build
	4. observe the following errors:
	   - x11/kdebase @ i386> checking for utmp file... no
	   - Bulk build ended: Thu Apr 10 14:29:57 GMT 2003
	     can not chdir(/var/spool/mqueue): No such file or directory

	Apply this patch:

--- /usr/pkgsrc/mk/bulk/mksandbox.orig	Tue Dec 31 10:46:12 2002
+++ /usr/pkgsrc/mk/bulk/mksandbox	Wed Feb  5 12:55:05 2003
@@ -213,6 +213,13 @@
 $chownprog games:games $sandbox/var/games
 $chmodprog 2775 $sandbox/var/games
+echo "Making /var/run in $sandbox"
+$mkdirprog $sandbox/var/run
+cp /dev/null $sandbox/var/run/utmp
+echo "Making /var/spool/mqueue in $sandbox"
+$mkdirprog $sandbox/var/spool/mqueue
 echo "Mount $src from $sandbox"
 $mkdirprog $sandbox/usr/src
 $mountprog $mountflags -r $src $sandbox/usr/src