From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#35874: =?UTF-8?Q?=E2=80=9Cguix_?= =?UTF-8?Q?pull=E2=80=9D?= fails on setlocale Date: Sat, 25 May 2019 19:17:55 +0200 Message-ID: <87ef4mqwqk.fsf@gnu.org> References: <87y32wga23.fsf@mdc-berlin.de> <87woigg88w.fsf@mdc-berlin.de> <877eagx8s2.fsf@gnu.org> <87tvdkdjsh.fsf@mdc-berlin.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:54209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUafk-0003QR-RV for bug-guix@gnu.org; Sat, 25 May 2019 13:41:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUaJy-0002oc-9A for bug-guix@gnu.org; Sat, 25 May 2019 13:19:15 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35965) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hUaJy-0002oL-4j for bug-guix@gnu.org; Sat, 25 May 2019 13:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hUaJx-0002bH-R5 for bug-guix@gnu.org; Sat, 25 May 2019 13:19:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87tvdkdjsh.fsf@mdc-berlin.de> (Ricardo Wurmus's message of "Fri, 24 May 2019 16:11:26 +0200") 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" To: Ricardo Wurmus Cc: 35874@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Ricardo Wurmus skribis: > Ludovic Court=C3=A8s writes: [...] >> When you do =E2=80=98guix pull=E2=80=99, the resulting (guix config) is = supposed to >> honor the settings of the calling =E2=80=98guix=E2=80=99: %localstatedir= , etc. >> >> It seems that it wasn=E2=80=99t the case here? Could you try again runn= ing >> =E2=80=98guix pull=E2=80=99 from a =E2=80=98guix=E2=80=99 command that h= as non-default settings and >> check the resulting (guix config) module? > > Is (guix config) enough? What about the daemon? I=E2=80=99ve had no pro= blem > with =E2=80=9Cguix=E2=80=9D itself when used with a daemon taken from the= git checkout. Oooh, good point, the =E2=80=98guix-daemon=E2=80=99 package uses a fixed lo= calstatedir. I believe the patch below solves the problem. WDYT? > Yes, I was able to identify the corrupt store items and copy the > corresponding items from a separate machine. I was lucky that it > aborted early when trying to delete items, so it seems that it didn=E2=80= =99t > get to do all that much damage. Phheeew. > (Curiously, I wasn=E2=80=99t able to run =E2=80=9Cguix gc --verify=3Drepa= ir,contents=E2=80=9D > because Guix claims I don=E2=80=99t have sufficient privileges to repair = the > store =E2=80=94 I=E2=80=99m running this as root, but who knows how NFS c= omplicates > things=E2=80=A6) It=E2=80=99s supposed to work if you=E2=80=99re root, and the privilege cla= im checks just that (see nix-daemon.cc): --8<---------------cut here---------------start------------->8--- if (remoteAddr.ss_family =3D=3D AF_UNIX) { [=E2=80=A6] trusted =3D clientUid =3D=3D 0; [=E2=80=A6] =20=20=20=20 case wopVerifyStore: { bool checkContents =3D readInt(from) !=3D 0; bool repair =3D readInt(from) !=3D 0; startWork(); if (repair && !trusted) throw Error("you are not privileged to repair paths"); bool errors =3D store->verifyStore(checkContents, repair); stopWork(); writeInt(errors, to); break; } --8<---------------cut here---------------end--------------->8--- Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/self.scm b/guix/self.scm index 6d7569ec19..8cc82de64c 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -603,7 +603,21 @@ Info manual." (define (wrap daemon) (program-file "guix-daemon" #~(begin + ;; Refer to the right 'guix' command for 'guix + ;; substitute' & co. (setenv "GUIX" #$command) + + ;; Honor the user's settings rather than those hardcoded + ;; in the 'guix-daemon' package. + (unless (getenv "GUIX_STATE_DIRECTORY") + (setenv "GUIX_STATE_DIRECTORY" + #$(string-append %localstatedir "/guix"))) + (unless (getenv "GUIX_CONFIGURATION_DIRECTORY") + (setenv "GUIX_CONFIGURATION_DIRECTORY" + #$(string-append %sysconfdir "/guix"))) + (unless (getenv "NIX_STORE_DIR") + (setenv "NIX_STORE_DIR" %storedir)) + (apply execl #$(file-append daemon "/bin/guix-daemon") "guix-daemon" (cdr (command-line)))))) --=-=-=--