From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Daemon: nix-connection-error Date: Mon, 24 Jun 2013 01:05:36 +0200 Message-ID: <871u7s77i7.fsf@gnu.org> References: <8738saswuk.fsf@karetnikov.org> <87obaygpf8.fsf@gnu.org> <874ncq15fs.fsf@karetnikov.org> <87vc55gbj8.fsf@gnu.org> <8761x5wvz8.fsf@karetnikov.org> <878v21f9nz.fsf@gnu.org> <878v203geo.fsf@karetnikov.org> <87vc547f5v.fsf@gnu.org> <87li608pr8.fsf@karetnikov.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqtQi-00006d-Jg for bug-guix@gnu.org; Sun, 23 Jun 2013 19:10:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UqtQg-0007dl-TL for bug-guix@gnu.org; Sun, 23 Jun 2013 19:10:44 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:55417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqtQg-0007dh-Ks for bug-guix@gnu.org; Sun, 23 Jun 2013 19:10:42 -0400 In-Reply-To: <87li608pr8.fsf@karetnikov.org> (Nikita Karetnikov's message of "Mon, 24 Jun 2013 01:46:03 +0400") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: bug-guix@gnu.org Nikita Karetnikov skribis: >> Ah, so this was not the log of a chroot build, right? (There=E2=80=99s = no >> /homeless-shelter directory in the chroot.) > > I'm puzzled. The manual says that "each build process is run in a > chroot environment." [1] However, I see > > export HOME=3D"/homeless-shelter" > > in '/tmp/nix-build-coreutils-8.21.drv-7/environment-variables'. > > Is anything wrong with Guix, or is it my fault? What makes you think there=E2=80=99s a contradiction here? Turns out $HOME is automatically set by the daemon for each build (from nix/libstore/build.cc): /* Set HOME to a non-existing path to prevent certain programs from usi= ng /etc/passwd (or NIS, or whatever) to locate the home directory (for example, wget looks for ~/.wgetrc). I.e., these tools use /etc/pass= wd if HOME is not set, but they will just assume that the settings file they are looking for does not exist if HOME is set but points to some non-existing path. */ Path homeDir =3D "/homeless-shelter"; env["HOME"] =3D homeDir; Yet, the daemon runs builds in a chroot, or complains if it cannot for some reason (unless HAVE_CHROOT is unset.) Can you check that HAVE_CHROOT is set, and that the build users exist? >> Not sure what --userspec is. > > 'chroot --userspec=3DUSER:GROUP' allows to specify a user and a group. And what would you do with that? As explained in the manual, the normal setup is to run the daemon as root with --build-users-group; it then automatically calls chroot(2) and seteuid(2) in the child processes that run the builds. HTH, Ludo=E2=80=99.