all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Nikita Karetnikov <nikita@karetnikov.org>
Cc: bug-guix@gnu.org
Subject: Re: Daemon: nix-connection-error
Date: Mon, 24 Jun 2013 01:05:36 +0200	[thread overview]
Message-ID: <871u7s77i7.fsf@gnu.org> (raw)
In-Reply-To: <87li608pr8.fsf@karetnikov.org> (Nikita Karetnikov's message of "Mon, 24 Jun 2013 01:46:03 +0400")

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>> Ah, so this was not the log of a chroot build, right?  (There’s 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="/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’s 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 using
       /etc/passwd (or NIS, or whatever) to locate the home directory (for
       example, wget looks for ~/.wgetrc).  I.e., these tools use /etc/passwd
       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 = "/homeless-shelter";
    env["HOME"] = 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=USER: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’.

      reply	other threads:[~2013-06-23 23:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-22  2:28 Daemon: nix-connection-error Nikita Karetnikov
2013-06-22 15:01 ` Ludovic Courtès
2013-06-22 16:22   ` Nikita Karetnikov
2013-06-22 20:01     ` Ludovic Courtès
2013-06-22 23:45       ` Nikita Karetnikov
2013-06-23  9:39         ` Ludovic Courtès
2013-06-23 17:06           ` Nikita Karetnikov
2013-06-23 20:20             ` Ludovic Courtès
2013-06-23 21:46               ` Nikita Karetnikov
2013-06-23 23:05                 ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871u7s77i7.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=bug-guix@gnu.org \
    --cc=nikita@karetnikov.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.