From unknown Sat Jun 21 10:33:44 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#36785 <36785@debbugs.gnu.org> To: bug#36785 <36785@debbugs.gnu.org> Subject: Status: 'sudo guix pull' failure in the profile migration code Reply-To: bug#36785 <36785@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:33:44 +0000 retitle 36785 'sudo guix pull' failure in the profile migration code reassign 36785 guix submitter 36785 Julien Lepiller severity 36785 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 24 10:40:51 2019 Received: (at submit) by debbugs.gnu.org; 24 Jul 2019 14:40:51 +0000 Received: from localhost ([127.0.0.1]:37842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqIRj-0007Tg-I1 for submit@debbugs.gnu.org; Wed, 24 Jul 2019 10:40:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:32808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqIRi-0007TZ-0h for submit@debbugs.gnu.org; Wed, 24 Jul 2019 10:40:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33617) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqIRh-0006E5-0R for bug-guix@gnu.org; Wed, 24 Jul 2019 10:40:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_40,RCVD_IN_SBL_CSS autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hqIRf-0003NK-3i for bug-guix@gnu.org; Wed, 24 Jul 2019 10:40:44 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:54100) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hqIRe-0003LX-Rg for bug-guix@gnu.org; Wed, 24 Jul 2019 10:40:43 -0400 Received: from [131.254.252.98] (205.emeraldonion.org [23.129.64.205]) by lepiller.eu (OpenSMTPD) with ESMTPSA id 920a0358 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Wed, 24 Jul 2019 14:40:38 +0000 (UTC) Date: Wed, 24 Jul 2019 16:40:42 +0200 User-Agent: K-9 Mail for Android MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Impossible to pull on foreign distro To: bug-guix@gnu.org From: Julien Lepiller Message-ID: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:5884:8208::1 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi guix, I gave a small tutorial to someone today, where we installed guix on top of a foreign distro. We used the script and everything went smoothly, and after finding out that we were going to build php (we [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [23.129.64.205 listed in zen.spamhaus.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) Hi guix, I gave a small tutorial to someone today, where we installed guix on top o= f a foreign distro=2E We used the script and everything went smoothly, and = after finding out that we were going to build php (we were trying to define= a VM that would serve one of their services), we tried to run guix pull: sudo guix pull =E2=80=94commit=3D=E2=80=A6 However the command failed immediately with: Migrating profile generations to '/var/guix/profiles/per-user/root'=2E=2E= =2E Guix pull: error: symlink: File exists: "/var/guix/profiles/per-user/root/= current-guix" Indeed, the file exists and everything looks good=2E Why does guix try to = migrate a profile that's already good? I was able to work around that situation, but it's not great for our users= =2E From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 25 19:03:20 2019 Received: (at 36785) by debbugs.gnu.org; 25 Jul 2019 23:03:20 +0000 Received: from localhost ([127.0.0.1]:40592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqmlb-0006au-LA for submit@debbugs.gnu.org; Thu, 25 Jul 2019 19:03:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqmlY-0006ag-1A for 36785@debbugs.gnu.org; Thu, 25 Jul 2019 19:03:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hqmlS-0000q5-Rq; Thu, 25 Jul 2019 19:03:10 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49996 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hqmlR-0002U9-NG; Thu, 25 Jul 2019 19:03:10 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 8 Thermidor an 227 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 26 Jul 2019 01:03:08 +0200 In-Reply-To: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> (Julien Lepiller's message of "Wed, 24 Jul 2019 16:40:42 +0200") Message-ID: <874l39ra37.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Julien, Julien Lepiller skribis: > I gave a small tutorial to someone today, where we installed guix on top = of a foreign distro. We used the script and everything went smoothly, and a= fter finding out that we were going to build php (we were trying to define = a VM that would serve one of their services), we tried to run guix pull: > > sudo guix pull =E2=80=94commit=3D=E2=80=A6 > > However the command failed immediately with: > > Migrating profile generations to '/var/guix/profiles/per-user/root'... > Guix pull: error: symlink: File exists: "/var/guix/profiles/per-user/root= /current-guix" > > Indeed, the file exists and everything looks good. Why does guix try to m= igrate a profile that's already good? > > I was able to work around that situation, but it's not great for our user= s. I=E2=80=99m guessing the machine had remnants of a previous Guix installati= on, no? See: ;; In 0.15.0+ we'd create ~/.config/guix/current-[0-9]*-link symlinks. M= ove ;; them to %PROFILE-DIRECTORY. (unless (string=3D? %profile-directory (dirname (canonicalize-profile %user-profile-directory)= )) (migrate-generations %user-profile-directory %profile-directory)) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 26 02:22:05 2019 Received: (at 36785) by debbugs.gnu.org; 26 Jul 2019 06:22:05 +0000 Received: from localhost ([127.0.0.1]:40726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqtcC-0004S3-N3 for submit@debbugs.gnu.org; Fri, 26 Jul 2019 02:22:04 -0400 Received: from lepiller.eu ([89.234.186.109]:35554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqtcA-0004Rd-KF for 36785@debbugs.gnu.org; Fri, 26 Jul 2019 02:22:03 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 9e98a86d; Fri, 26 Jul 2019 06:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lepiller.eu; h=date :in-reply-to:references:mime-version:content-type :content-transfer-encoding:subject:to:cc:from:message-id; s= dkim; bh=BA7HlOTERs0zlhGGACG1DCgs9bo=; b=AXoiKT2pA58oH32gmnEa123 rK5gBuAZYDRpHqKk+deKoiILvZkePTPIMM2RSDSHi9US4syknjWjEr89PMTMzrso kNbywP0TAUG3r1sCWEsc7X973yuzDpX7ayBvP9Ew+L0iqWKeuykMzx6b+HWo/5lq YHxm8qVecoB2t9EPpXiTtSn+o1P89tmU8ssZ2a0wSe11VvyxOiduL1TFOVhbuUIT rqXbA5s/4cPqasF0zVxO8Szp9codAJyhtjucnRFKFg0EGfYgYUwACJ+yzQEWzQZN OU6nwB/WqBjPt3B6XdR8z/qnTnYuNv2QNbnoEXn/jh7vmawtOJvujZRnNi5NFFQ= = DomainKey-Signature: a=rsa-sha1; c=nofws; d=lepiller.eu; h=date :in-reply-to:references:mime-version:content-type :content-transfer-encoding:subject:to:cc:from:message-id; q=dns; s=dkim; b=Ff2Me78XsMX1Z9TQfLX8CirM8rjIhplgsprVMJzX/ursoxGKWPHpQ yjghJV+5Xi02yw1XMr3jEJP1GnscUM0jWfRwA0X38qplaEQ0NOqyMEzxsUjIstzs i1ept4SkLOH5gtPrSHT8qt0hF3ON425Rlg3Qqjp36zMzge1WVCIlSAYzBKC3zTkJ 4ba/TjGH0tFBtCp+qsB4XqZ73rx/ajJ98QnzRyBZzXU+mxWRlYL0eXDuXm3X/YZ6 gE82qDppMCJiN2am2w1QC6Er1hR8VlnlrUQO24WXDbbo4ADPA7P8YWNfzZ7LIwKG pn3mhAunA1SKIuHSaYQjek3zQxRVUqflQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id f47cf94f (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Fri, 26 Jul 2019 06:21:59 +0000 (UTC) Date: Fri, 26 Jul 2019 08:22:01 +0200 User-Agent: K-9 Mail for Android In-Reply-To: <874l39ra37.fsf@gnu.org> References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: bug#36785: Impossible to pull on foreign distro To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= From: Julien Lepiller Message-ID: <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le 26 juillet 2019 01:03:08 GMT+02:00, "Ludovic Court=C3=A8s" a =C3=A9crit : >Hi Julien, > >Julien Lepiller skribis: > >> I gave a small tutorial to someone today, where we installed guix on >top of a foreign distro=2E We used the script and everything went >smoothly, and after finding out that we were going to build php (we >were trying to define a VM that would serve one of their services), we >tried to run guix pull: >> >> sudo guix pull =E2=80=94commit=3D=E2=80=A6 >> >> However the command failed immediately with: >> >> Migrating profile generations to >'/var/guix/profiles/per-user/root'=2E=2E=2E >> Guix pull: error: symlink: File exists: >"/var/guix/profiles/per-user/root/current-guix" >> >> Indeed, the file exists and everything looks good=2E Why does guix try >to migrate a profile that's already good? >> >> I was able to work around that situation, but it's not great for our >users=2E > >I=E2=80=99m guessing the machine had remnants of a previous Guix installa= tion, >no? See: > >;; In 0=2E15=2E0+ we'd create ~/=2Econfig/guix/current-[0-9]*-link symlin= ks=2E=20 >Move > ;; them to %PROFILE-DIRECTORY=2E > (unless (string=3D? %profile-directory > (dirname (canonicalize-profile %user-profile-directory))) > (migrate-generations %user-profile-directory %profile-directory)) > >Ludo=E2=80=99=2E Not at all, this was the first install on that machine=2E The OS was even = installed recently, so there can't be any remnant of the 0=2E15 era :)=2E I= nstallation went smoothly and /root/=2Econfig/guix/current was already a sy= mlink to /var/guix/profiles/per-user/root=2E We ran guix pull as user just = before and it worked perfectly well (with the message about migrating, alth= ough ~/=2Econfig/guix/current didn't exist)=2E Could there be some veird interaction between sudo and these %profile-dire= ctory and %user-profile-directory variables? From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 26 04:09:16 2019 Received: (at 36785) by debbugs.gnu.org; 26 Jul 2019 08:09:16 +0000 Received: from localhost ([127.0.0.1]:40778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqvHw-0000lN-4m for submit@debbugs.gnu.org; Fri, 26 Jul 2019 04:09:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqvHu-0000l8-7N for 36785@debbugs.gnu.org; Fri, 26 Jul 2019 04:09:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hqvHm-0002qO-3S; Fri, 26 Jul 2019 04:09:06 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=57130 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hqvHk-0002PK-Ir; Fri, 26 Jul 2019 04:09:04 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> Date: Fri, 26 Jul 2019 10:09:02 +0200 In-Reply-To: <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> (Julien Lepiller's message of "Fri, 26 Jul 2019 08:22:01 +0200") Message-ID: <87tvb9qktd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Julien, Julien Lepiller skribis: > Le 26 juillet 2019 01:03:08 GMT+02:00, "Ludovic Court=C3=A8s" a =C3=A9crit : [...] >>;; In 0.15.0+ we'd create ~/.config/guix/current-[0-9]*-link symlinks.=20 >>Move >> ;; them to %PROFILE-DIRECTORY. >> (unless (string=3D? %profile-directory >> (dirname (canonicalize-profile %user-profile-directory))) >> (migrate-generations %user-profile-directory %profile-directory)) [...] > Could there be some veird interaction between sudo and these %profile-dir= ectory and %user-profile-directory variables? Indeed. I added =E2=80=98pk=E2=80=99 calls to print =E2=80=98%profile-dire= ctory=E2=80=99 and (canonicalize-profile %user-profile-directory), and here=E2=80=99s what I s= ee with =E2=80=98sudo=E2=80=99: --8<---------------cut here---------------start------------->8--- $ sudo -E ./pre-inst-env guix pull ;;; (pd "/var/guix/profiles/per-user/root") ;;; (upd "/home/ludo/.config/guix/current") Migrating profile generations to '/var/guix/profiles/per-user/root'... guix pull: error: symlink: Dosiero jam ekzistas: "/var/guix/profiles/per-us= er/root/current-guix" --8<---------------cut here---------------end--------------->8--- =E2=80=98%user-profile-directory=E2=80=99 is computed as a function of $HOM= E, which is unchanged when using =E2=80=98sudo=E2=80=99, whereas =E2=80=98%profile-dire= ctory=E2=80=99 is computed as a function of $USER. I think $HOME should always prevail over the home directory defined in /etc/passwd, so think we should not change the way =E2=80=98%user-profile-directory=E2=80=99 is computed. We could do this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1721,7 +1721,8 @@ because the NUMBER is zero.)" (define %profile-directory (string-append %state-directory "/profiles/" - (or (and=> (or (getenv "USER") + (or (and=> (or (getenv "SUDO_USER") + (getenv "USER") (getenv "LOGNAME")) (cut string-append "per-user/" <>)) "default"))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E2=80=A6 but then =E2=80=98sudo guix pull=E2=80=99 won=E2=80=99t update ro= ot=E2=80=99s guix at all. Otherwise I=E2=80=99m thinking of this gross hack: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 54bbaddf30..8d8a8aa889 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -293,8 +293,9 @@ true, display what would be built without actually buil= ding it." =20 ;; In 0.15.0+ we'd create ~/.config/guix/current-[0-9]*-link symlinks. = Move ;; them to %PROFILE-DIRECTORY. - (unless (string=3D? %profile-directory - (dirname (canonicalize-profile %user-profile-directory= ))) + (unless (or (getenv "SUDO_USER") + (string=3D? (pk 'pd %profile-directory) + (dirname (pk 'upd (canonicalize-profile %user-prof= ile-directory))))) (migrate-generations %user-profile-directory %profile-directory)) =20 ;; Make sure ~/.config/guix/current points to /var/guix/profiles/=E2=80= =A6. --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I think it=E2=80=99s acceptable because that=E2=80=99s =E2=80=9Cthrow away= =E2=80=9D code anyway, and it=E2=80=99s not supposed to be triggered these days. Thoughts? Ludo=E2=80=99. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 26 05:20:41 2019 Received: (at control) by debbugs.gnu.org; 26 Jul 2019 09:20:41 +0000 Received: from localhost ([127.0.0.1]:40846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqwP2-0000bn-Qh for submit@debbugs.gnu.org; Fri, 26 Jul 2019 05:20:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqwP1-0000bb-Bc for control@debbugs.gnu.org; Fri, 26 Jul 2019 05:20:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hqwOw-0002Fz-5t for control@debbugs.gnu.org; Fri, 26 Jul 2019 05:20:34 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=57280 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hqwOu-0001JI-IH for control@debbugs.gnu.org; Fri, 26 Jul 2019 05:20:33 -0400 Date: Fri, 26 Jul 2019 11:20:30 +0200 Message-Id: <87ef2dqhi9.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #36785 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) retitle 36785 'sudo guix pull' failure in the profile migration code quit From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 17 03:36:08 2019 Received: (at control) by debbugs.gnu.org; 17 Sep 2019 07:36:08 +0000 Received: from localhost ([127.0.0.1]:51566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iA81w-00077J-DC for submit@debbugs.gnu.org; Tue, 17 Sep 2019 03:36:08 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:30378) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iA81r-00076X-HU for control@debbugs.gnu.org; Tue, 17 Sep 2019 03:36:06 -0400 X-IronPort-AV: E=Sophos;i="5.64,515,1559512800"; d="scan'208";a="319641497" Received: from unknown (HELO ribbon) ([193.50.110.233]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 17 Sep 2019 09:35:23 +0200 Date: Tue, 17 Sep 2019 09:35:23 +0200 Message-Id: <874l1bs7d0.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #36785 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) merge 36785 37148 quit From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 17 18:03:20 2019 Received: (at 36785) by debbugs.gnu.org; 17 Sep 2019 22:03:20 +0000 Received: from localhost ([127.0.0.1]:53397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iALZ9-0000jn-Jo for submit@debbugs.gnu.org; Tue, 17 Sep 2019 18:03:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59931) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iALZ7-0000jZ-8o for 36785@debbugs.gnu.org; Tue, 17 Sep 2019 18:03:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iALYu-0000ZQ-2w; Tue, 17 Sep 2019 18:03:05 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=48516 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iALYt-0004NS-IF; Tue, 17 Sep 2019 18:03:03 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> Date: Wed, 18 Sep 2019 00:03:01 +0200 In-Reply-To: <87tvb9qktd.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 26 Jul 2019 10:09:02 +0200") Message-ID: <87woe6fune.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, Tobias Geerinckx-Rice X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Ludovic Court=C3=A8s skribis: > Indeed. I added =E2=80=98pk=E2=80=99 calls to print =E2=80=98%profile-di= rectory=E2=80=99 and > (canonicalize-profile %user-profile-directory), and here=E2=80=99s what I= see > with =E2=80=98sudo=E2=80=99: > > $ sudo -E ./pre-inst-env guix pull > > ;;; (pd "/var/guix/profiles/per-user/root") > > ;;; (upd "/home/ludo/.config/guix/current") I used =E2=80=98-E=E2=80=99 above, which is why HOME was ~ludo instead of ~= root. Without =E2=80=98-E=E2=80=99, HOME is ~root as expected, and so =E2=80=9Csu= do guix pull=E2=80=9D does the right thing (this is on Guix System): --8<---------------cut here---------------start------------->8--- $ sudo guix repl GNU Guile 2.2.4 Copyright (C) 1995-2017 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guix-user)> (getenv "HOME") $1 =3D "/root" scheme@(guix-user)> ,m(guix scripts pull) scheme@(guix scripts pull)> %profile-directory $2 =3D "/var/guix/profiles/per-user/root" scheme@(guix scripts pull)> %user-profile-directory $3 =3D "/root/.config/guix/current" scheme@(guix scripts pull)> (cache-directory) $4 =3D "/root/.cache/guix" scheme@(guix scripts pull)> (config-directory) $5 =3D "/root/.config/guix" --8<---------------cut here---------------end--------------->8--- So =E2=80=98sudo guix pull=E2=80=99 really updates root=E2=80=99s profile a= nd writes to ~root/.cache, everything is fine. Done? I investigated a bit, tried Debian, then Ubuntu, and found that =E2=80=98su= do=E2=80=99 on Ubuntu behaves differently: it preserves =E2=80=98HOME=E2=80=99 by defau= lt: $ sudo env | grep HOME HOME=3D/home/ubuntu This is written here: https://help.ubuntu.com/community/RootSudo#Special_notes_on_sudo_and_shel= ls (That=E2=80=99s with sudo 1.8.21p2, FWIW.) Ubuntu=E2=80=99s /etc/sudoers doesn=E2=80=99t have anything special. Actua= lly, Debian has (almost) the same /etc/sudoers and yet it does not preserve HOME. (Time passes=E2=80=A6) Digging further, I fetched the source from , and boom! I found the culprit: it=E2=80=99s called =E2=80=98debian/patches/keep_home_by_default.p= atch=E2=80=99. --8<---------------cut here---------------start------------->8--- Description: Set HOME in initial_keepenv_table Set HOME in initial_keepenv_table; without this, $HOME will never be=20 preserved unless added to keep_env. There's appropriate logic to handle resetting the home for -H and -i options, so this is the only part that's missing. Author: Steve Langasek --- a/plugins/sudoers/env.c +++ b/plugins/sudoers/env.c @@ -189,6 +189,7 @@ "COLORS", "DISPLAY", "DPKG_COLORS", + "HOME", "HOSTNAME", "KRB5CCNAME", "LS_COLORS", --8<---------------cut here---------------end--------------->8--- (This patch is playing with fire IMO. If you=E2=80=99re an Ubuntu user, consider reporting a bug!) But anyway, what can we do? We could ignore the issue, it=E2=80=99s-Ubuntu=E2=80=99s-fault, done. We could also add some logic to detect whether (1) we=E2=80=99re running un= der sudo, and in that case, and whether (2) $HOME matches $USER=E2=80=99s home directory as it appears in /etc/passwd. If both conditions are satisfied, we could ignore $HOME and use the home directory from /etc/passwd instead. But=E2=80=A6 that=E2=80=99s complicated, and it=E2=80=99d break uses of =E2= =80=98sudo -H=E2=80=99. We could apply the patch I posted earlier, which simply disables profile migration when SUDO_USER is set. That won=E2=80=99t address the fact that = root writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we can = do here. Thoughts? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 17 19:34:00 2019 Received: (at 36785) by debbugs.gnu.org; 17 Sep 2019 23:34:00 +0000 Received: from localhost ([127.0.0.1]:53408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAMyt-0003BM-Jv for submit@debbugs.gnu.org; Tue, 17 Sep 2019 19:34:00 -0400 Received: from mail-ed1-f51.google.com ([209.85.208.51]:41362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAMys-0003B4-14 for 36785@debbugs.gnu.org; Tue, 17 Sep 2019 19:33:58 -0400 Received: by mail-ed1-f51.google.com with SMTP id f20so2466457edv.8 for <36785@debbugs.gnu.org>; Tue, 17 Sep 2019 16:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m/C1Uq0RHJnb9su2L/IeaU+NWFvKThtoUM1ef92jvpY=; b=Gc5VPC7ej6owOZYtX3FABaEKvi++SSSWWYtPZb57Rcpf0ge+148zzxpnMfCJO8FqkL aSKh1YYbx9bkhQtQthvgf79J1MreiLRqJS2mBLNAQl7n6OFLze99zV9Kti5xiTRUOLwu UGcx2UBsQfP8UrhYWTR2tFXnSHcO//BUJTLL6od23Fsjk/UP5biDNblQwmt+6qB6rBrG CjMcmB/1M5cq5iSxmmhoWk2CJf0YcuamrC+wU3QPnHjapvOINr1AYDY+rukXW2Qc48Z9 lPtxCKh9TMcVucRfpUeHKCfLtiQ97yJJrNwxy0S+qd+IKuxfUUueF2Rd/QcA3vlc2mF/ dVlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m/C1Uq0RHJnb9su2L/IeaU+NWFvKThtoUM1ef92jvpY=; b=PnvtXCIGcAO4XISM5K5C5rt71lwCvRIQwCGQbARmHBP+ginQtz/izZ1p9FXr/BXK02 2uBfLbvK/FxWwYtm80f4dR//nbTEyBjp47eBfjrmJ2QxGMMpOxDkXddulWq3j70g03lf 9YYcsoBAd4o0KZAxfNcqbXmCtDlOGoPnuIwgL3JZvFpLD7GX2gxqmWDkJACZKFcdVDzb OD7R9FZC38aDuAUkSWo0MYTxZBMgkcohzTdlDMhvrRYpBlXRJYpIOznmd5eOjd4HNTt2 s04lTW4C3y0biElVb+Q5KGVb8iVzFa5m4vfnbNEMbRxFYHKFTYuuKMmKYmP+2S88u5CI Y78A== X-Gm-Message-State: APjAAAXA5gcaa3lQdHOjd8HGjKhoQqblR+WZJuR+YtRIEMmKDbi6gH4p knlXOejejR++n958ccDBFzp7CF4mlfpYlXvGdg== X-Google-Smtp-Source: APXvYqyMfRNvCXXJaX1bDrvGJfctsu5CcNF7TIn6gszKkSnZi78kecBiWg803c9+fL3B82WyySV0xhyymG9v1iNQ7wQ= X-Received: by 2002:a17:906:c742:: with SMTP id fk2mr7105097ejb.44.1568763231918; Tue, 17 Sep 2019 16:33:51 -0700 (PDT) MIME-Version: 1.0 References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> In-Reply-To: <87woe6fune.fsf@gnu.org> From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Date: Wed, 18 Sep 2019 01:33:40 +0200 Message-ID: Subject: Re: bug#36785: Impossible to pull on foreign distro To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Content-Type: multipart/alternative; boundary="0000000000002cde500592c82710" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, Julien Lepiller X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000002cde500592c82710 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Ludo, Ludovic Court=C3=A8s ezt =C3=ADrta (id=C5=91pont: 2019. szep= t. 18., Sze, 0:04): > Hi, > > Ludovic Court=C3=A8s skribis: > > > Indeed. I added =E2=80=98pk=E2=80=99 calls to print =E2=80=98%profile-= directory=E2=80=99 and > > (canonicalize-profile %user-profile-directory), and here=E2=80=99s what= I see > > with =E2=80=98sudo=E2=80=99: > > > > $ sudo -E ./pre-inst-env guix pull > > > > ;;; (pd "/var/guix/profiles/per-user/root") > > > > ;;; (upd "/home/ludo/.config/guix/current") > > I used =E2=80=98-E=E2=80=99 above, which is why HOME was ~ludo instead of= ~root. > Without =E2=80=98-E=E2=80=99, HOME is ~root as expected, and so =E2=80=9C= sudo guix pull=E2=80=9D does > the right thing (this is on Guix System): > > --8<---------------cut here---------------start------------->8--- > $ sudo guix repl > GNU Guile 2.2.4 > Copyright (C) 1995-2017 Free Software Foundation, Inc. > > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. > This program is free software, and you are welcome to redistribute it > under certain conditions; type `,show c' for details. > > Enter `,help' for help. > scheme@(guix-user)> (getenv "HOME") > $1 =3D "/root" > scheme@(guix-user)> ,m(guix scripts pull) > scheme@(guix scripts pull)> %profile-directory > $2 =3D "/var/guix/profiles/per-user/root" > scheme@(guix scripts pull)> %user-profile-directory > $3 =3D "/root/.config/guix/current" > scheme@(guix scripts pull)> (cache-directory) > $4 =3D "/root/.cache/guix" > scheme@(guix scripts pull)> (config-directory) > $5 =3D "/root/.config/guix" > --8<---------------cut here---------------end--------------->8--- > > So =E2=80=98sudo guix pull=E2=80=99 really updates root=E2=80=99s profile= and writes to > ~root/.cache, everything is fine. > > Done? > > I investigated a bit, tried Debian, then Ubuntu, and found that =E2=80=98= sudo=E2=80=99 > on Ubuntu behaves differently: it preserves =E2=80=98HOME=E2=80=99 by def= ault: > > $ sudo env | grep HOME > HOME=3D/home/ubuntu > > This is written here: > > > https://help.ubuntu.com/community/RootSudo#Special_notes_on_sudo_and_shel= ls > > (That=E2=80=99s with sudo 1.8.21p2, FWIW.) > > Ubuntu=E2=80=99s /etc/sudoers doesn=E2=80=99t have anything special. Act= ually, Debian > has (almost) the same /etc/sudoers and yet it does not preserve HOME. > > (Time passes=E2=80=A6) > > Digging further, I fetched the source from > , and boom! I found the > culprit: it=E2=80=99s called =E2=80=98debian/patches/keep_home_by_default= .patch=E2=80=99. > > --8<---------------cut here---------------start------------->8--- > Description: Set HOME in initial_keepenv_table > Set HOME in initial_keepenv_table; without this, $HOME will never be > preserved unless added to keep_env. There's appropriate logic to handle > resetting the home for -H and -i options, so this is the only part that'= s > missing. > Author: Steve Langasek > --- a/plugins/sudoers/env.c > +++ b/plugins/sudoers/env.c > @@ -189,6 +189,7 @@ > "COLORS", > "DISPLAY", > "DPKG_COLORS", > + "HOME", > "HOSTNAME", > "KRB5CCNAME", > "LS_COLORS", > --8<---------------cut here---------------end--------------->8--- > > (This patch is playing with fire IMO. If you=E2=80=99re an Ubuntu user, > consider reporting a bug!) > > But anyway, what can we do? > > We could ignore the issue, it=E2=80=99s-Ubuntu=E2=80=99s-fault, done. > > We could also add some logic to detect whether (1) we=E2=80=99re running = under > sudo, and in that case, and whether (2) $HOME matches $USER=E2=80=99s hom= e > directory as it appears in /etc/passwd. If both conditions are > satisfied, we could ignore $HOME and use the home directory from > /etc/passwd instead. > > But=E2=80=A6 that=E2=80=99s complicated, and it=E2=80=99d break uses of = =E2=80=98sudo -H=E2=80=99. > > We could apply the patch I posted earlier, which simply disables profile > migration when SUDO_USER is set. That won=E2=80=99t address the fact tha= t root > writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we ca= n do here. > > Thoughts? > We could simply document a proper sudo invocation for updating root's guix, that always works. Wdyt? We could provide it simply as a hint if it fails. > > Ludo=E2=80=99. > > > > Best regards, g_bor --=20 OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21 --0000000000002cde500592c82710 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Ludo,

Ludovic Court=C3=A8s <ludo@gnu.org> ezt =C3=ADrta (id=C5=91pont: = 2019. szept. 18., Sze, 0:04):
Hi,

Ludovic Court=C3=A8s <= ludo@gnu.org> skribis:

> Indeed.=C2=A0 I added =E2=80=98pk=E2=80=99 calls to print =E2=80=98%pr= ofile-directory=E2=80=99 and
> (canonicalize-profile %user-profile-directory), and here=E2=80=99s wha= t I see
> with =E2=80=98sudo=E2=80=99:
>
> $ sudo -E ./pre-inst-env guix pull
>
> ;;; (pd "/var/guix/profiles/per-user/root")
>
> ;;; (upd "/home/ludo/.config/guix/current")

I used =E2=80=98-E=E2=80=99 above, which is why HOME was ~ludo instead of ~= root.
Without =E2=80=98-E=E2=80=99, HOME is ~root as expected, and so =E2=80=9Csu= do guix pull=E2=80=9D does
the right thing (this is on Guix System):

--8<---------------cut here---------------start------------->8---
$ sudo guix repl
GNU Guile 2.2.4
Copyright (C) 1995-2017 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> (getenv "HOME")
$1 =3D "/root"
scheme@(guix-user)> ,m(guix scripts pull)
scheme@(guix scripts pull)> %profile-directory
$2 =3D "/var/guix/profiles/per-user/root"
scheme@(guix scripts pull)> %user-profile-directory
$3 =3D "/root/.config/guix/current"
scheme@(guix scripts pull)> (cache-directory)
$4 =3D "/root/.cache/guix"
scheme@(guix scripts pull)> (config-directory)
$5 =3D "/root/.config/guix"
--8<---------------cut here---------------end--------------->8---

So =E2=80=98sudo guix pull=E2=80=99 really updates root=E2=80=99s profile a= nd writes to
~root/.cache, everything is fine.

Done?

I investigated a bit, tried Debian, then Ubuntu, and found that =E2=80=98su= do=E2=80=99
on Ubuntu behaves differently: it preserves =E2=80=98HOME=E2=80=99 by defau= lt:

=C2=A0 $ sudo env | grep HOME
=C2=A0 HOME=3D/home/ubuntu

This is written here:

=C2=A0 https://help.ubunt= u.com/community/RootSudo#Special_notes_on_sudo_and_shells

(That=E2=80=99s with sudo 1.8.21p2, FWIW.)

Ubuntu=E2=80=99s /etc/sudoers doesn=E2=80=99t have anything special.=C2=A0 = Actually, Debian
has (almost) the same /etc/sudoers and yet it does not preserve HOME.

(Time passes=E2=80=A6)

Digging further, I fetched the source from
<https://packages.ubuntu.com/bionic/sudo>, and boom= ! I found the
culprit: it=E2=80=99s called =E2=80=98debian/patches/keep_home_by_default.p= atch=E2=80=99.

--8<---------------cut here---------------start------------->8---
Description: Set HOME in initial_keepenv_table
=C2=A0Set HOME in initial_keepenv_table; without this, $HOME will never be =
=C2=A0preserved unless added to keep_env.=C2=A0 There's appropriate log= ic to handle
=C2=A0resetting the home for -H and -i options, so this is the only part th= at's
=C2=A0missing.
Author: Steve Langasek <steve.langasek@canonical.com>
--- a/plugins/sudoers/env.c
+++ b/plugins/sudoers/env.c
@@ -189,6 +189,7 @@
=C2=A0 =C2=A0 =C2=A0"COLORS",
=C2=A0 =C2=A0 =C2=A0"DISPLAY",
=C2=A0 =C2=A0 =C2=A0"DPKG_COLORS",
+=C2=A0 =C2=A0 "HOME",
=C2=A0 =C2=A0 =C2=A0"HOSTNAME",
=C2=A0 =C2=A0 =C2=A0"KRB5CCNAME",
=C2=A0 =C2=A0 =C2=A0"LS_COLORS",
--8<---------------cut here---------------end--------------->8---

(This patch is playing with fire IMO.=C2=A0 If you=E2=80=99re an Ubuntu use= r,
consider reporting a bug!)

But anyway, what can we do?

We could ignore the issue, it=E2=80=99s-Ubuntu=E2=80=99s-fault, done.

We could also add some logic to detect whether (1) we=E2=80=99re running un= der
sudo, and in that case, and whether (2) $HOME matches $USER=E2=80=99s home<= br> directory as it appears in /etc/passwd.=C2=A0 If both conditions are
satisfied, we could ignore $HOME and use the home directory from
/etc/passwd instead.

But=E2=80=A6 that=E2=80=99s complicated, and it=E2=80=99d break uses of =E2= =80=98sudo -H=E2=80=99.

We could apply the patch I posted earlier, which simply disables profile migration when SUDO_USER is set.=C2=A0 That won=E2=80=99t address the fact = that root
writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we can = do here.

Thoughts?

We could simply document a pr= oper sudo invocation for updating root's guix, that
always wo= rks. Wdyt?

We could provide it simply as a hint if= it fails.
=C2=A0

Ludo=E2=80=99.




Best regards,
g_b= or
--
OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:C= F63:0B21
--0000000000002cde500592c82710-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 18 04:50:40 2019 Received: (at 36785) by debbugs.gnu.org; 18 Sep 2019 08:50:40 +0000 Received: from localhost ([127.0.0.1]:53566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAVfc-0000xB-Be for submit@debbugs.gnu.org; Wed, 18 Sep 2019 04:50:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAVfa-0000ww-BF for 36785@debbugs.gnu.org; Wed, 18 Sep 2019 04:50:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iAVdl-0005MU-SI; Wed, 18 Sep 2019 04:50:28 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49842 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iAVdl-0007l0-BQ; Wed, 18 Sep 2019 04:48:45 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?G=C3=A1bor?= Boskovits Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Jour du =?utf-8?Q?G=C3=A9nie?= de =?utf-8?Q?l'Ann?= =?utf-8?Q?=C3=A9e?= 227 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 18 Sep 2019 10:48:42 +0200 In-Reply-To: (=?utf-8?Q?=22G=C3=A1bor?= Boskovits"'s message of "Wed, 18 Sep 2019 01:33:40 +0200") Message-ID: <87h85af0r9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, Julien Lepiller X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, G=C3=A1bor Boskovits skribis: > We could simply document a proper sudo invocation for updating root's gui= x, > that > always works. Wdyt? The thing is =E2=80=9Csudo guix pull=E2=80=9D works on all (?) distros but = Ubuntu, which provides a patched sudo. So we=E2=80=99d have to explicitly mention Ubuntu. That=E2=80=99s probably a good idea, though chances are people will run =E2= =80=9Csudo guix pull=E2=80=9D before they=E2=80=99ve read that footnote in the manual.= (A colleague of mine ran =E2=80=9Csudo guix pull=E2=80=9D mostly because they = were used to =E2=80=9Csudo apt-get update=E2=80=9D and didn=E2=80=99t really think =E2= =80=98sudo=E2=80=99 was unnecessary.) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 18 14:35:34 2019 Received: (at 36785) by debbugs.gnu.org; 18 Sep 2019 18:35:35 +0000 Received: from localhost ([127.0.0.1]:54815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAene-0003Sw-H0 for submit@debbugs.gnu.org; Wed, 18 Sep 2019 14:35:34 -0400 Received: from sender4-of-o52.zoho.com ([136.143.188.52]:21220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAenc-0003So-3J for 36785@debbugs.gnu.org; Wed, 18 Sep 2019 14:35:32 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1568831724; cv=none; d=zoho.com; s=zohoarc; b=mWUTJq6N9OvfKsdJ6Izb90EGhkjiDgChgPe3XeohIVO3PEtOUaplUem0LCquGFaoXRIf2SrXxdPu5AEDKASTWhXnvyzUYBGirJre8ATWcOPyW1jPXDa7rNnnU7vArQw4lM3wXjYfK/DKp7rW+3Mhi6/v0fYOqj0Ik9BmSH4To80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568831724; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=HmAhPV1kURPML6ekB/aePT7Waba/j7yZV5ny+ucKmjc=; b=OaQ3ikNAxtOINPgv7y9U4p7H2D/Uqen+Zv9Bh102tIH+U7ap0ae0MiEHft32T2xMSOz3/3gCUwyrK4Lngi/zNGmFe8GR9yx8Pe6jDUpOsGRXwCivDsUGpio5hrlKmE/z4C0Qw19aNnljmTiuh0SAfZpsiBOf14Nvr3YXcZzCHxI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1568831724; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; l=1400; bh=HmAhPV1kURPML6ekB/aePT7Waba/j7yZV5ny+ucKmjc=; b=gmInfTH9y4FbwaQE2nsHzJ/rDFcUfLciCC90ovU5PX3Tf6l3wfDEseiN95BIfK9h cmEO3rE9+AR8JVAYsBl0u4P6W4Q6O+wPVOcYGavjg/ddWTM5GRjaVrj5EKRbtcgUMwX vOyxNBpa4JR8EEXnDXex8dqZhSUXC2ZBjD8hxHHU= Received: from localhost (p54AD4E3E.dip0.t-ipconnect.de [84.173.78.62]) by mx.zohomail.com with SMTPS id 1568831722903604.3006250975964; Wed, 18 Sep 2019 11:35:22 -0700 (PDT) References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> User-agent: mu4e 1.2.0; emacs 26.2 From: Ricardo Wurmus To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36785: Impossible to pull on foreign distro In-reply-to: <87woe6fune.fsf@gnu.org> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Wed, 18 Sep 2019 20:35:19 +0200 Message-ID: <87o8zho3ko.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, Julien Lepiller X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ludovic Court=C3=A8s writes: > Digging further, I fetched the source from > , and boom! I found the > culprit: it=E2=80=99s called =E2=80=98debian/patches/keep_home_by_default= .patch=E2=80=99. > > --8<---------------cut here---------------start------------->8--- > Description: Set HOME in initial_keepenv_table > Set HOME in initial_keepenv_table; without this, $HOME will never be=20 > preserved unless added to keep_env. There's appropriate logic to handle > resetting the home for -H and -i options, so this is the only part that's > missing. > Author: Steve Langasek > --- a/plugins/sudoers/env.c > +++ b/plugins/sudoers/env.c > @@ -189,6 +189,7 @@ > "COLORS", > "DISPLAY", > "DPKG_COLORS", > + "HOME", > "HOSTNAME", > "KRB5CCNAME", > "LS_COLORS", > --8<---------------cut here---------------end--------------->8--- > > (This patch is playing with fire IMO. If you=E2=80=99re an Ubuntu user, > consider reporting a bug!) Wow. Changing fundamental behaviour like that is bad. > We could apply the patch I posted earlier, which simply disables profile > migration when SUDO_USER is set. That won=E2=80=99t address the fact tha= t root > writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we ca= n do here. This sounds fine to me. --=20 Ricardo From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 19 04:24:27 2019 Received: (at 36785-done) by debbugs.gnu.org; 19 Sep 2019 08:24:27 +0000 Received: from localhost ([127.0.0.1]:55127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iArjn-0002r1-4t for submit@debbugs.gnu.org; Thu, 19 Sep 2019 04:24:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iArjl-0002qn-O1 for 36785-done@debbugs.gnu.org; Thu, 19 Sep 2019 04:24:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iArjg-0003ot-78; Thu, 19 Sep 2019 04:24:20 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=56070 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iArjf-00029p-Qe; Thu, 19 Sep 2019 04:24:20 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Ricardo Wurmus Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87o8zho3ko.fsf@elephly.net> Date: Thu, 19 Sep 2019 10:24:18 +0200 In-Reply-To: <87o8zho3ko.fsf@elephly.net> (Ricardo Wurmus's message of "Wed, 18 Sep 2019 20:35:19 +0200") Message-ID: <87lfuky9ql.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36785-done Cc: 36785-done@debbugs.gnu.org, Julien Lepiller X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Ricardo Wurmus skribis: > Ludovic Court=C3=A8s writes: [...] >> We could apply the patch I posted earlier, which simply disables profile >> migration when SUDO_USER is set. That won=E2=80=99t address the fact th= at root >> writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we c= an do here. > > This sounds fine to me. I went ahead and pushed that as ee25048e51dd45ad91a1ad4b0f25f4013843c52b. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 04:47:25 2019 Received: (at 36785) by debbugs.gnu.org; 20 Sep 2019 08:47:25 +0000 Received: from localhost ([127.0.0.1]:56755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBEZY-0003zx-Kw for submit@debbugs.gnu.org; Fri, 20 Sep 2019 04:47:25 -0400 Received: from mail-pl1-f181.google.com ([209.85.214.181]:42168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBEZW-0003uN-FP for 36785@debbugs.gnu.org; Fri, 20 Sep 2019 04:47:23 -0400 Received: by mail-pl1-f181.google.com with SMTP id e5so2866003pls.9 for <36785@debbugs.gnu.org>; Fri, 20 Sep 2019 01:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=6ddQmOPIOLzcwYJshBdCwR2+7hO99JO8neuJyEp9Rto=; b=RGKTqCd0LE4+QtArElgDYN3nlYAisXxnSfVsXJa47G/NsYHkn6Mv0N4VhhukbLl6/Q JTCAooJz5HFvCht/lYmy9ZRMPX0DVUTLhR35XIKqQct1dXigXG7pfzpZXQttx3FUxQfB PBr73rPdCe6Z68XCeGasy00vCOGaE6zVIvzU7gAmMOlJyxyIOjufMuRZI209s1L2Nzb8 66vodnE5Q4vu0jbHK/3Xk9ZlT2ZfBcYkt8BhNhzDhZb/U2UgqaQvPDkePPu+oyr8+grb M5cQkvd3EMtb2AY3kH59JoqSpmeJlCOdbHVlGubVFjfRxtwyJJJUeFczdmQXVaA4VuJ7 ic9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=6ddQmOPIOLzcwYJshBdCwR2+7hO99JO8neuJyEp9Rto=; b=PyRcWy3Rv6d4Dvz6ODUkhXMhoGWWTOAsCV4YUjrHpY7J50hC2oAJJSByfUST89OMjl Z4WhuKZIibLpuc3xduIqnkODA/zZefGckKvcSWeFKGplSmH9fbgjadu3PgQ3fgiFBd8R mPhGcjzwrioEzuTppzo1KyLnjJgz2T/z3z59MfMJrxVMnrv9v8q/0jdmIaCRsR865/aT c1UvN6OmRD5Cq1USvQCwZzaKQO5hGLN8gdWFwePpGUp+6wzduhIx6tKx9HcaY0QAqNRi FzIwBfwnxY8TsIVIaLpUZ4I0PSW0aOFcikKRLD2qe+ShehjKqjf1BiMey7Z9O210+i94 k4Nw== X-Gm-Message-State: APjAAAUcKzR9mMv1IYxCBINwQcQWgah1sSm4ijCUKNog207CAeflGfTc MJL8WWgxY3XvwcLudxL5+Je3eDBm X-Google-Smtp-Source: APXvYqwV7IuxdkXej7Vv4cdvuYAncTpS9N9u+ZxnPTjhvljM4kyacGNd6rUvUWBkKv2Czs1U4Sp1jA== X-Received: by 2002:a17:902:7846:: with SMTP id e6mr12307582pln.136.1568969236351; Fri, 20 Sep 2019 01:47:16 -0700 (PDT) Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6]) by smtp.gmail.com with ESMTPSA id w6sm3431272pfj.17.2019.09.20.01.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 01:47:15 -0700 (PDT) From: Maxim Cournoyer To: =?utf-8?Q?G=C3=A1bor?= Boskovits Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> Date: Fri, 20 Sep 2019 17:47:11 +0900 In-Reply-To: (=?utf-8?Q?=22G=C3=A1bor?= Boskovits"'s message of "Wed, 18 Sep 2019 01:33:40 +0200") Message-ID: <87pnjv73sg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, G=C3=A1bor Boskovits writes: > Hello Ludo, > > Ludovic Court=C3=A8s ezt =C3=ADrta (id=C5=91pont: 2019. sz= ept. 18., Sze, > 0:04): > >> Hi, >> >> Ludovic Court=C3=A8s skribis: >> >> > Indeed. I added =E2=80=98pk=E2=80=99 calls to print =E2=80=98%profile= -directory=E2=80=99 and >> > (canonicalize-profile %user-profile-directory), and here=E2=80=99s wha= t I see >> > with =E2=80=98sudo=E2=80=99: >> > >> > $ sudo -E ./pre-inst-env guix pull >> > >> > ;;; (pd "/var/guix/profiles/per-user/root") >> > >> > ;;; (upd "/home/ludo/.config/guix/current") >> >> I used =E2=80=98-E=E2=80=99 above, which is why HOME was ~ludo instead o= f ~root. >> Without =E2=80=98-E=E2=80=99, HOME is ~root as expected, and so =E2=80= =9Csudo guix pull=E2=80=9D does >> the right thing (this is on Guix System): >> >> --8<---------------cut here---------------start------------->8--- >> $ sudo guix repl >> GNU Guile 2.2.4 >> Copyright (C) 1995-2017 Free Software Foundation, Inc. >> >> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. >> This program is free software, and you are welcome to redistribute it >> under certain conditions; type `,show c' for details. >> >> Enter `,help' for help. >> scheme@(guix-user)> (getenv "HOME") >> $1 =3D "/root" >> scheme@(guix-user)> ,m(guix scripts pull) >> scheme@(guix scripts pull)> %profile-directory >> $2 =3D "/var/guix/profiles/per-user/root" >> scheme@(guix scripts pull)> %user-profile-directory >> $3 =3D "/root/.config/guix/current" >> scheme@(guix scripts pull)> (cache-directory) >> $4 =3D "/root/.cache/guix" >> scheme@(guix scripts pull)> (config-directory) >> $5 =3D "/root/.config/guix" >> --8<---------------cut here---------------end--------------->8--- >> >> So =E2=80=98sudo guix pull=E2=80=99 really updates root=E2=80=99s profil= e and writes to >> ~root/.cache, everything is fine. >> >> Done? >> >> I investigated a bit, tried Debian, then Ubuntu, and found that =E2=80= =98sudo=E2=80=99 >> on Ubuntu behaves differently: it preserves =E2=80=98HOME=E2=80=99 by de= fault: >> >> $ sudo env | grep HOME >> HOME=3D/home/ubuntu >> >> This is written here: >> >> >> https://help.ubuntu.com/community/RootSudo#Special_notes_on_sudo_and_she= lls >> >> (That=E2=80=99s with sudo 1.8.21p2, FWIW.) >> >> Ubuntu=E2=80=99s /etc/sudoers doesn=E2=80=99t have anything special. Ac= tually, Debian >> has (almost) the same /etc/sudoers and yet it does not preserve HOME. >> >> (Time passes=E2=80=A6) >> >> Digging further, I fetched the source from >> , and boom! I found the >> culprit: it=E2=80=99s called =E2=80=98debian/patches/keep_home_by_defaul= t.patch=E2=80=99. >> >> --8<---------------cut here---------------start------------->8--- >> Description: Set HOME in initial_keepenv_table >> Set HOME in initial_keepenv_table; without this, $HOME will never be >> preserved unless added to keep_env. There's appropriate logic to handle >> resetting the home for -H and -i options, so this is the only part that= 's >> missing. >> Author: Steve Langasek >> --- a/plugins/sudoers/env.c >> +++ b/plugins/sudoers/env.c >> @@ -189,6 +189,7 @@ >> "COLORS", >> "DISPLAY", >> "DPKG_COLORS", >> + "HOME", >> "HOSTNAME", >> "KRB5CCNAME", >> "LS_COLORS", >> --8<---------------cut here---------------end--------------->8--- >> >> (This patch is playing with fire IMO. If you=E2=80=99re an Ubuntu user, >> consider reporting a bug!) >> >> But anyway, what can we do? >> >> We could ignore the issue, it=E2=80=99s-Ubuntu=E2=80=99s-fault, done. >> >> We could also add some logic to detect whether (1) we=E2=80=99re running= under >> sudo, and in that case, and whether (2) $HOME matches $USER=E2=80=99s ho= me >> directory as it appears in /etc/passwd. If both conditions are >> satisfied, we could ignore $HOME and use the home directory from >> /etc/passwd instead. >> >> But=E2=80=A6 that=E2=80=99s complicated, and it=E2=80=99d break uses of = =E2=80=98sudo -H=E2=80=99. >> >> We could apply the patch I posted earlier, which simply disables profile >> migration when SUDO_USER is set. That won=E2=80=99t address the fact th= at root >> writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we c= an do here. >> >> Thoughts? >> > > We could simply document a proper sudo invocation for updating root's gui= x, > that > always works. Wdyt? > > We could provide it simply as a hint if it fails. Indeed, the default recommended invocation to update the root's guix could be changed to be 'sudo -i guix pull', which should work on all systems including Ubuntu. Maxim From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 11:44:43 2019 Received: (at 36785) by debbugs.gnu.org; 20 Sep 2019 15:44:43 +0000 Received: from localhost ([127.0.0.1]:58321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBL5P-00027u-Ho for submit@debbugs.gnu.org; Fri, 20 Sep 2019 11:44:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38629) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBL5N-00027h-OX for 36785@debbugs.gnu.org; Fri, 20 Sep 2019 11:44:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iBL5B-00020x-Rl; Fri, 20 Sep 2019 11:44:31 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=45934 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iBL5B-0000Kv-Di; Fri, 20 Sep 2019 11:44:29 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Jour de la Raison de =?utf-8?Q?l'Ann=C3=A9e?= 227 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 20 Sep 2019 17:44:26 +0200 In-Reply-To: <87pnjv73sg.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 20 Sep 2019 17:47:11 +0900") Message-ID: <87woe3otut.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, =?utf-8?Q?G=C3=A1bor?= Boskovits X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Maxim Cournoyer skribis: > Indeed, the default recommended invocation to update the root's guix > could be changed to be 'sudo -i guix pull', which should work on all > systems including Ubuntu. Oh right. Could you make this change in the manual? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 08:31:31 2019 Received: (at 36785) by debbugs.gnu.org; 21 Sep 2019 12:31:31 +0000 Received: from localhost ([127.0.0.1]:59309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBeXz-0000rF-6m for submit@debbugs.gnu.org; Sat, 21 Sep 2019 08:31:31 -0400 Received: from mail-pl1-f170.google.com ([209.85.214.170]:45856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBeXx-0000r1-Aj for 36785@debbugs.gnu.org; Sat, 21 Sep 2019 08:31:29 -0400 Received: by mail-pl1-f170.google.com with SMTP id u12so4436212pls.12 for <36785@debbugs.gnu.org>; Sat, 21 Sep 2019 05:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=gicE2Af+LD+7FiJCQKaRPmKCNLDQNn7HpgN91waxiQM=; b=vLtyCSDsz2XiLelV1fBZFZYbnhv3Bw3wiXgZIBN8qSzzqEvoudAHDq6XwBoPCSMzvd SUaLnkvve7I2jA597lLeiHR9/hQI/eElGmemD7Ccd0QZqJVCc6FIDEHaEeFR5m3dK59o u30uHhrI8HMMq49/LgtlYuDprMyLIfhhcnzjy9A4Eo1hIPX08t8NrY26MTm/Pb2E+gwP CHbWaSmsitMTpsyYW3AIe5FA8oB6Zp9UsG1xP8VU4nvVyLTB5Gv7tXIpb3G0d7S13N4E ZK0jT2jT/qFE10SqPwOHssBo5qt7Qas3TgP9IHK0OT+GdwoxIA8Srs+iAI3DkElBQY18 pSfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=gicE2Af+LD+7FiJCQKaRPmKCNLDQNn7HpgN91waxiQM=; b=YdjJLWPCy/RcWviovfpaaqtRA8orx85ksdB/j+KJROZsRxVmKcX+3Oia9Qo2i5G1z6 nefgRUMZLjBILGQBM7NUfbhKa6aowbJ9ekQEa6/LQN4Js9efH0rQAsTyjnUdigUIzl2w HdSAbMGmvLGLwI8jtZHCv7/+Jx6Yjo94Am1t2TgqwhtGD0+Cyyc0lclucQIMzuTb63WZ x8KdjP+zbfwZBIuDCQdjWfsBewekgXx4C46pqiXzr9g9+0uKVwZzDfU8xtYKZBfqPcf5 0Zv+BG6D3g3g2DIPOBu8uk/by6q1iCa30MFVj6YNiOHx+FOjEVcPJoTsoNzfBn6ntPPm BINA== X-Gm-Message-State: APjAAAXHbkEGNxJfvx5157jNpWvG1flJEDgbSC5U3fArp/8f6rMzdJ7m ai12ByxpXSn7SekMTXKd9TWQK7ePXso= X-Google-Smtp-Source: APXvYqwI3HztmUadlGBeIpo2wQ7WCL9ygg1Q1yUzzjMqQHldCjy687IvM2zsGP0U1xyh1VKGX+DeYQ== X-Received: by 2002:a17:902:a508:: with SMTP id s8mr21193001plq.317.1569069083286; Sat, 21 Sep 2019 05:31:23 -0700 (PDT) Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6]) by smtp.gmail.com with ESMTPSA id 16sm5856951pfi.55.2019.09.21.05.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2019 05:31:20 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> <87woe3otut.fsf@gnu.org> Date: Sat, 21 Sep 2019 21:31:16 +0900 In-Reply-To: <87woe3otut.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 20 Sep 2019 17:44:26 +0200") Message-ID: <87pnjt6dbf.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, =?utf-8?Q?G=C3=A1bor?= Boskovits X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Ludovic Court=C3=A8s writes: > Maxim Cournoyer skribis: > >> Indeed, the default recommended invocation to update the root's guix >> could be changed to be 'sudo -i guix pull', which should work on all >> systems including Ubuntu. > > Oh right. Could you make this change in the manual? > > Thanks, > Ludo=E2=80=99. I looked at what was in the manual, and became less sure, thought maybe 'sudo -E' could be better, so I've done the following little experiment using Docker to test an Ubuntu enviroment: Here's the Dockerfile, with instructions to reproduce in it: =2D-8<---------------cut here---------------start------------->8--- FROM ubuntu RUN apt-get update && apt-get install sudo RUN useradd -ms /bin/bash user RUN usermod -aG sudo user RUN echo user:user | chpasswd USER user CMD bash # To test (in the directory where this file is written as 'Dockerfile'): # docker build . # docker run -it --rm # Then run the following commands: # export PATH=3Dextra-stuff:$PATH # sudo -E sh -c 'echo -e "env when using -E: \n$(env)\n\n"' # sudo -i sh -c 'echo -e "env when using -i: \n$(env)\n\n"' # sudo sh -c 'echo -e "env with plain sudo: $(env)\n\n"' =2D-8<---------------cut here---------------end--------------->8--- And the result: =2D-8<---------------cut here---------------start------------->8--- echo $PATH echo $PATH extra-stuff:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 0;user@e538556bf337: /=07user@e538556bf337:/$ sudo -E sh -c 'echo -e "env w= hen using -E: \n$(env)\n\n"' sudo -E sh -c 'echo -e "env when using -E: \n$(env)\n\n"' =2De env when using -E: SUDO_GID=3D1000 USER=3Droot HOSTNAME=3De538556bf337 SHLVL=3D1 HOME=3D/home/user SUDO_UID=3D1000 LOGNAME=3Droot _=3D/usr/bin/sudo TERM=3Dxterm USERNAME=3Droot PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b= in LS_COLORS=3Drs=3D0:di=3D01;34:[...] SUDO_COMMAND=3D/bin/sh -c echo -e "env when using -E: $(env) " SHELL=3D/bin/bash SUDO_USER=3Duser PWD=3D/ 0;user@e538556bf337: /=07user@e538556bf337:/$ sudo -i sh -c 'echo -e "env w= hen using -i: \n$(env)\n\n"' sudo -i sh -c 'echo -e "env when using -i: \n$(env)\n\n"' =2De env when using -i: SUDO_GID=3D1000 MAIL=3D/var/mail/root USER=3Droot HOSTNAME=3De538556bf337 SHLVL=3D1 HOME=3D/root SUDO_UID=3D1000 LOGNAME=3Droot _=3D/bin/sh USERNAME=3Droot TERM=3Dxterm PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b= in LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36: [...] $(env) " SHELL=3D/bin/bash SUDO_USER=3Duser PWD=3D/root user@e538556bf337: /=07user@e538556bf337:/$ sudo sh -c 'echo -e "env with p= lain sudo: $(env)\n\n"' sudo sh -c 'echo -e "env with plain sudo: $(env)\n\n"' =2De env with plain sudo: SUDO_GID=3D1000 MAIL=3D/var/mail/root USER=3Droot HOSTNAME=3De538556bf337 HOME=3D/home/user SUDO_UID=3D1000 LOGNAME=3Droot TERM=3Dxterm USERNAME=3Droot PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b= in LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36: [...] SUDO_COMMAND=3D/bin/sh -c echo -e "env with plain sudo: $(env) " SHELL=3D/bin/bash SUDO_USER=3Duser PWD=3D/ =2D-8<---------------cut here---------------end--------------->8--- What do we get from this? Well, first, the user's PATH is *not* preserved when using 'sudo', at least on Debian and Ubuntu. These are configured out of the box to reset the PATH to a 'safe' value, even when using the -E option of sudo. We also see, as Ludovic found out, that the user's HOME is preserved for the normal invocation of sudo on Ubuntu. In light of this, I suggest the attached patch to our documentation. It's a bit sub-optimal in that it modifies a section of the 'Guix System', which behaved as described; but given that it's the only place where we mention of 'sudo guix pull', better safe than sorry, I'd say (foreign distribution users might read it, thinking it also applies to themselves). Does that seem worthwile/reasonable? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-doc-Adapt-the-guix-pull-command-recommendation.patch Content-Transfer-Encoding: quoted-printable From=20bfa2f754592a00fefa4fcd20080582268b6273dd Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 21 Sep 2019 20:36:04 +0900 Subject: [PATCH] doc: Adapt the guix pull command recommendation. This change follows the discussion for issue #36785 (see: https://bugs.gnu.org/36785). * doc/guix.texi (After System Installation): Add the '-i' sudo option to the suggested commands used to keep a Guix System up-to-date. Although this section is specific to Guix System, it is likely to be read by users of foreign GNU/Linux distributions as well. Remove the note, given that sudo doesn't preserve the user's PATH on foreign distributions such as Debian. =2D-- doc/guix.texi | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 0ed59072c9..3690e3b152 100644 =2D-- a/doc/guix.texi +++ b/doc/guix.texi @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System! From th= en on, you can update the system whenever you want by running, say: =20 @example =2Dguix pull =2Dsudo guix system reconfigure /etc/config.scm +sudo -i guix pull +sudo -i guix system reconfigure /etc/config.scm @end example =20 @noindent @@ -2396,14 +2396,6 @@ This builds a new system generation with the latest = packages and services (@pxref{Invoking guix system}). We recommend doing that regularly so that your system includes the latest security updates (@pxref{Security Updates}= ). =20 =2D@c See . =2D@quotation Note =2D@cindex sudo vs. @command{guix pull} =2DNote that @command{sudo guix} runs your user's @command{guix} command and =2D@emph{not} root's, because @command{sudo} leaves @code{PATH} unchanged. = To =2Dexplicitly run root's @command{guix}, type @command{sudo -i guix @dots{}= }. =2D@end quotation =2D Join us on @code{#guix} on the Freenode IRC network or on @email{guix-devel@@gnu.org} to share your experience! =20 =2D-=20 2.23.0 --=-=-= Content-Type: text/plain Thanks, Maxim --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAl2GGBQACgkQEmDkZILm NWLV9BAAkGt82u3y+MSaNkr8coJCT3W7f5MSd+caCBd/GGp/wP4jyO9ALal7ATuk Yu5ClnphDf3Q5KTJBaFkVolckyAKuXLVFdwvm3z78RZzYecSkgaKQtlOxcAdB/rU 4awBjkHb89S0V1ogHhJwj+UcJ4z3D/Mk1MiA5WmqUamPlRaQJisQsUWpm42S4F5E jbBBxzTW6IANssVTzbXiuxdqnyug1qraQjq8gmSAD9Thd7Kxnr5f49nSSJp93Glg fZP7LxNgnBPFVhgE9urQSGvTCg6SgSi1VVREcJQZ7pHcZerRjbSJ8QA8zd1EWijR /Z1k3hlP6xo3EpTFrAMTep7xK+oI8JL+4CUw+vL7/m/uv+3JrcqzEX2M6p3I23NW KB8DmkUlh6mzZ270YhGsgmqkujMSuZK9Z8tcVf80ZbIVkZZYDpJTGR4CXYP3zhDW BR6Qad51kqGEQjdvAZIXHF79zvpbOvQfV+iKMy4mqIK5rP2c+oYHWGU4A6nwjA+m mSSBb5ssBm8JF4p9w6uv68m+bD9lOzacHf8QXSeF8ga5VURYqp9S3clGRE2TJL40 /gD3Bxdal5LqlWE4d+5PCHFIsee3BF9/mBw9wwnxK53ZX7xc9Tp+b9rYtvbiCVYi OhEHyBcT7k6YMF+TG5SWtw7yjLihhvYcjyRP2fF0l0zcKAp78Hg= =fDx5 -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 08:32:27 2019 Received: (at 36785) by debbugs.gnu.org; 21 Sep 2019 12:32:27 +0000 Received: from localhost ([127.0.0.1]:59313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBeYs-0000t3-Oe for submit@debbugs.gnu.org; Sat, 21 Sep 2019 08:32:27 -0400 Received: from mail-pg1-f175.google.com ([209.85.215.175]:42414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBeYq-0000sp-Ve for 36785@debbugs.gnu.org; Sat, 21 Sep 2019 08:32:25 -0400 Received: by mail-pg1-f175.google.com with SMTP id z12so5357835pgp.9 for <36785@debbugs.gnu.org>; Sat, 21 Sep 2019 05:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=KQmvfzRztBB4rMdQrIPGUHhfrYCoNck4yorFAp0dml8=; b=udznSO+qW7URj71dmdF8LdPzMkGUui7NPWattFXodnfAoZprlvva6sjX+xsZ1IL8SY kPp1q8HisuzPfCx975L5L70gGu0AQyNqbhN7A9BViweWH6/X+iUrsSQh1knmwNw2Syn3 hUKZyiKEnnG4TPftCqRVG8HXwcA6073vJyDQD903dycEYwaoqbHHW/kR6lQ/z/myvZUu 2eaWr7RhMKlYqTvIazfezTKjrxIZvRkREyK3JSQdReqPix5BrcvxcYSxqmUZP5gFifsk 1jKFJ+oSVwjDvmMjRP9TbXX61JXA13wlvVK/V2uUawbPAW+CKVhoKGYxBjdgiHplUzgr aubQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=KQmvfzRztBB4rMdQrIPGUHhfrYCoNck4yorFAp0dml8=; b=Yq6ggWGHX74H+DiFtYPO9J3RHc5l3wqSnHxtYiYLFDv8g9tDuTkdsoKy31GZnNL8cb loeaNPLiMlO2gfwBgtRRUgxTvSO+2AulOotukB1kkadREOPZVeHahK1eX95BFgH7A+zb LXQue8b4jKqKUkWE2mEvlvIc58c4tFPsANpDo/qyt/rnl7URMzpEGMywW9qwwnRMlx1W Kdt1B3fx5DoEY4A23RW8KD1tt50ST6Ahgl9lqqWOzK7UH2A5E9tEVAxiGRf/UuQWtYR6 RYCKUD+GPEcqRgu81S4NN/d9u0aB0LOwsxIvyoaSEovunuKLRe/tVGGXD3IcirXgbBBx Yqvw== X-Gm-Message-State: APjAAAX+C+unWpQX9RmjI6TlTFR+ME7I5uMJ+i3Hc+KmTvuIxhTkcYl0 ISzCHg9HTCRTLOmtqP9hwCu/rIGCj4w= X-Google-Smtp-Source: APXvYqzWPkTFXZst+Smwz6HbVEN1XSo8Z3JZiMvjWeUiLJkXeVB+t7BV24nzolPhwPBTyUmtyIXpIg== X-Received: by 2002:a17:90a:8d84:: with SMTP id d4mr9958953pjo.139.1569069138786; Sat, 21 Sep 2019 05:32:18 -0700 (PDT) Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6]) by smtp.gmail.com with ESMTPSA id b3sm7909252pfp.65.2019.09.21.05.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2019 05:32:18 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36785: Impossible to pull on foreign distro In-Reply-To: <87woe3otut.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 20 Sep 2019 17:44:26 +0200") References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> <87woe3otut.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Date: Sat, 21 Sep 2019 21:32:13 +0900 Message-ID: <87o8zd6d9u.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, =?utf-8?Q?G=C3=A1bor?= Boskovits X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Ludovic Court=C3=A8s writes: > Maxim Cournoyer skribis: > >> Indeed, the default recommended invocation to update the root's guix >> could be changed to be 'sudo -i guix pull', which should work on all >> systems including Ubuntu. > > Oh right. Could you make this change in the manual? > > Thanks, > Ludo=E2=80=99. I looked at what was in the manual, and became less sure, thought maybe 'sudo -E' could be better, so I've done the following little experiment using Docker to test an Ubuntu enviroment: Here's the Dockerfile, with instructions to reproduce in it: =2D-8<---------------cut here---------------start------------->8--- FROM ubuntu RUN apt-get update && apt-get install sudo RUN useradd -ms /bin/bash user RUN usermod -aG sudo user RUN echo user:user | chpasswd USER user CMD bash # To test (in the directory where this file is written as 'Dockerfile'): # docker build . # docker run -it --rm # Then run the following commands: # export PATH=3Dextra-stuff:$PATH # sudo -E sh -c 'echo -e "env when using -E: \n$(env)\n\n"' # sudo -i sh -c 'echo -e "env when using -i: \n$(env)\n\n"' # sudo sh -c 'echo -e "env with plain sudo: $(env)\n\n"' =2D-8<---------------cut here---------------end--------------->8--- And the result: =2D-8<---------------cut here---------------start------------->8--- echo $PATH echo $PATH extra-stuff:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 0;user@e538556bf337: /=07user@e538556bf337:/$ sudo -E sh -c 'echo -e "env w= hen using -E: \n$(env)\n\n"' sudo -E sh -c 'echo -e "env when using -E: \n$(env)\n\n"' =2De env when using -E: SUDO_GID=3D1000 USER=3Droot HOSTNAME=3De538556bf337 SHLVL=3D1 HOME=3D/home/user SUDO_UID=3D1000 LOGNAME=3Droot _=3D/usr/bin/sudo TERM=3Dxterm USERNAME=3Droot PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b= in LS_COLORS=3Drs=3D0:di=3D01;34:[...] SUDO_COMMAND=3D/bin/sh -c echo -e "env when using -E: $(env) " SHELL=3D/bin/bash SUDO_USER=3Duser PWD=3D/ 0;user@e538556bf337: /=07user@e538556bf337:/$ sudo -i sh -c 'echo -e "env w= hen using -i: \n$(env)\n\n"' sudo -i sh -c 'echo -e "env when using -i: \n$(env)\n\n"' =2De env when using -i: SUDO_GID=3D1000 MAIL=3D/var/mail/root USER=3Droot HOSTNAME=3De538556bf337 SHLVL=3D1 HOME=3D/root SUDO_UID=3D1000 LOGNAME=3Droot _=3D/bin/sh USERNAME=3Droot TERM=3Dxterm PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b= in LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36: [...] $(env) " SHELL=3D/bin/bash SUDO_USER=3Duser PWD=3D/root user@e538556bf337: /=07user@e538556bf337:/$ sudo sh -c 'echo -e "env with p= lain sudo: $(env)\n\n"' sudo sh -c 'echo -e "env with plain sudo: $(env)\n\n"' =2De env with plain sudo: SUDO_GID=3D1000 MAIL=3D/var/mail/root USER=3Droot HOSTNAME=3De538556bf337 HOME=3D/home/user SUDO_UID=3D1000 LOGNAME=3Droot TERM=3Dxterm USERNAME=3Droot PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b= in LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36: [...] SUDO_COMMAND=3D/bin/sh -c echo -e "env with plain sudo: $(env) " SHELL=3D/bin/bash SUDO_USER=3Duser PWD=3D/ =2D-8<---------------cut here---------------end--------------->8--- What do we get from this? Well, first, the user's PATH is *not* preserved when using 'sudo', at least on Debian and Ubuntu. These are configured out of the box to reset the PATH to a 'safe' value, even when using the -E option of sudo. We also see, as Ludovic found out, that the user's HOME is preserved for the normal invocation of sudo on Ubuntu. In light of this, I suggest the attached patch to our documentation. It's a bit sub-optimal in that it modifies a section of the 'Guix System', which behaved as described; but given that it's the only place where we mention of 'sudo guix pull', better safe than sorry, I'd say (foreign distribution users might read it, thinking it also applies to themselves). Does that seem worthwile/reasonable? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-doc-Adapt-the-guix-pull-command-recommendation.patch Content-Transfer-Encoding: quoted-printable From=20bfa2f754592a00fefa4fcd20080582268b6273dd Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 21 Sep 2019 20:36:04 +0900 Subject: [PATCH] doc: Adapt the guix pull command recommendation. This change follows the discussion for issue #36785 (see: https://bugs.gnu.org/36785). * doc/guix.texi (After System Installation): Add the '-i' sudo option to the suggested commands used to keep a Guix System up-to-date. Although this section is specific to Guix System, it is likely to be read by users of foreign GNU/Linux distributions as well. Remove the note, given that sudo doesn't preserve the user's PATH on foreign distributions such as Debian. =2D-- doc/guix.texi | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 0ed59072c9..3690e3b152 100644 =2D-- a/doc/guix.texi +++ b/doc/guix.texi @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System! From th= en on, you can update the system whenever you want by running, say: =20 @example =2Dguix pull =2Dsudo guix system reconfigure /etc/config.scm +sudo -i guix pull +sudo -i guix system reconfigure /etc/config.scm @end example =20 @noindent @@ -2396,14 +2396,6 @@ This builds a new system generation with the latest = packages and services (@pxref{Invoking guix system}). We recommend doing that regularly so that your system includes the latest security updates (@pxref{Security Updates}= ). =20 =2D@c See . =2D@quotation Note =2D@cindex sudo vs. @command{guix pull} =2DNote that @command{sudo guix} runs your user's @command{guix} command and =2D@emph{not} root's, because @command{sudo} leaves @code{PATH} unchanged. = To =2Dexplicitly run root's @command{guix}, type @command{sudo -i guix @dots{}= }. =2D@end quotation =2D Join us on @code{#guix} on the Freenode IRC network or on @email{guix-devel@@gnu.org} to share your experience! =20 =2D-=20 2.23.0 --=-=-= Content-Type: text/plain Thanks, Maxim --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAl2GGE0ACgkQEmDkZILm NWI2rA/+Lqr51Nxe5dPWfQAkpMgF5hkiM+akelRB4prEXFvqmkIOf7Vor6BUR2+X xW9spQxzpt7lheP8dPsmFjMgLXdRir1Z+plqAnABIywwfL1jEicPWqxY7r3IdS54 f2w6s7p5AjjEftGHB0ixtrzLPRuxckCK1oBqpIJC+Bfq8fskw6q0qIiNbAoxwzGi EzCZDsnU4TudJg5AlgZflZy89Fdm7zxaTVQRmuKsNx9AOq7xC3holCzZDVntZ252 UzU7EPhx8UaLFQrcefWTkSBF9jL5wCfN5ZoFpu8xo60EdAqgOaQW2MZxMH4WA/7l PMMY7KA2QbpuIQfy8NzT9RItiVwztMB4sCBAy/hsgAca3FEPQb+TdCseRehh5WmF HSzUqh1GZISzxr9SgFRnuKgZ80Sd/RhTCW4x9QARzmpn0lhRBvvUk/5Rwte6uH8Q fCDDwZe4MBsoDu2GY/3BaQNcPb03XLre8fN/XO1qfzupOwe8uHQsC6ADSxTSlCkO h1Bi/7+MVm3ILxCCksNG8RfG+trgnS5tErDnXm0CI0SSfX76vpzs53JJdk5qb2ds 8vLZ9+lmRHRYiypYSnBVBZvz/5WS49iP85tWbwlrtsUFlMfyBIe4l+3wN4Y8MzO0 Dq5ZXb3tmYHvJGCfo8qEDexXew4jL4WbZNoEwut083HGB441cDo= =b+D6 -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 23 04:29:55 2019 Received: (at 36785) by debbugs.gnu.org; 23 Sep 2019 08:29:55 +0000 Received: from localhost ([127.0.0.1]:35026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCJjH-0003CO-49 for submit@debbugs.gnu.org; Mon, 23 Sep 2019 04:29:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCJjF-0003CB-Pq for 36785@debbugs.gnu.org; Mon, 23 Sep 2019 04:29:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iCJjA-0007gW-4N; Mon, 23 Sep 2019 04:29:48 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=37266 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iCJj8-0003pa-Jx; Mon, 23 Sep 2019 04:29:47 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> <87woe3otut.fsf@gnu.org> <87pnjt6dbf.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 =?utf-8?Q?Vend=C3=A9miaire?= an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 23 Sep 2019 10:29:43 +0200 In-Reply-To: <87pnjt6dbf.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 21 Sep 2019 21:31:16 +0900") Message-ID: <87d0frl8js.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, =?utf-8?Q?G=C3=A1bor?= Boskovits X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Maxim, Maxim Cournoyer skribis: > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System! From = then on, you can update the > system whenever you want by running, say: >=20=20 > @example > -guix pull > -sudo guix system reconfigure /etc/config.scm > +sudo -i guix pull > +sudo -i guix system reconfigure /etc/config.scm > @end example >=20=20 > @noindent > @@ -2396,14 +2396,6 @@ This builds a new system generation with the lates= t packages and services > (@pxref{Invoking guix system}). We recommend doing that regularly so th= at > your system includes the latest security updates (@pxref{Security Update= s}). >=20=20 > -@c See . > -@quotation Note > -@cindex sudo vs. @command{guix pull} > -Note that @command{sudo guix} runs your user's @command{guix} command and > -@emph{not} root's, because @command{sudo} leaves @code{PATH} unchanged. = To > -explicitly run root's @command{guix}, type @command{sudo -i guix @dots{}= }. > -@end quotation I think these bits were correct. That is, when running =E2=80=9Csudo foo=E2=80=9D, =E2=80=9Cfoo=E2=80=9D is = looked up in the user=E2=80=99s $PATH, not in root=E2=80=99s $PATH. That=E2=80=99s what led to this text i= n commit 796a4491fdaa4a0a3d669457b89356f9fbfc966e. So this part is fine. Perhaps we need another section for this? Or perhaps we can drop the ball=E2=80=A6 Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 23 05:01:12 2019 Received: (at 36785) by debbugs.gnu.org; 23 Sep 2019 09:01:12 +0000 Received: from localhost ([127.0.0.1]:35040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCKDW-0003wE-B4 for submit@debbugs.gnu.org; Mon, 23 Sep 2019 05:01:12 -0400 Received: from mail-ed1-f45.google.com ([209.85.208.45]:41050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCKDT-0003vm-0j for 36785@debbugs.gnu.org; Mon, 23 Sep 2019 05:01:08 -0400 Received: by mail-ed1-f45.google.com with SMTP id f20so12094658edv.8 for <36785@debbugs.gnu.org>; Mon, 23 Sep 2019 02:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UZiQvYp7FS9rsOY+z9PWW2bM+ocTZ4YI7fvfLpUJPoQ=; b=t27FeaTNVzKCdIkH6Rhdb9yLAZNeod6GqTWCMD9WNohW5MvDqwXg3xj9PnnW4JH8z9 ZqpybQ7olAEZI8iQcHSLAbH9CO8tBqblsY+Dm/HVw4QV2uKLBYMnAjsG+H+mxDEeL1aO +vjFpXaa6L/gv72joVtAEsCxoaefJ8U4P2I8eDk5NNJV87UEZX6PISx8zJEvFA/d9FkM uuH8fGVVtnNnOr1eHU8dZep/QaSwX+dfRYuH9qqM+0YatYCpqduRhxx7HRK+NOJmMU6k mUiQGr2oRvL4TA1gHf351knx19yjAhlYRo8//7ooPzPLi6AodJUrTjS2huMTekd8mlVm Ej5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UZiQvYp7FS9rsOY+z9PWW2bM+ocTZ4YI7fvfLpUJPoQ=; b=g6qVAXsWpGhx1g7U3h344KBlReX2socMI/Na9J94093onikDo+ezgAoXPOx7mm/jfV i6tazdJD5qSwrMS0g45UsW8et/JZgC6Kcm3kGICbhPrBN9W9ILkALOpRgDdZiSXpgqTL r0kecMtV5V6lckF3g2OH0DlRJ0YVj+modXM7QZVjv3L+K4o5tk5iqdml0/kI/uLOw9Vp SMXA/Ax9byMGf6CPVPuShxoKlDRu4S4R3+Jq9y4sVQ2wYXFAnDJyF5ovUPoKJAjsoct3 XrVGGLgnDvkPlOJOE+iFU1s3DI4RYV1NJRDGo1SivTl6CSM1EEOEW6+/brsluQPWP140 KM5g== X-Gm-Message-State: APjAAAWVX3LD9zQDZCLJ9Xbk94pfgQGPLukaYyjG21hiLCISqfzP6yY1 RqiIqVcRD6SKrLbjGeE8dOMqCmdceFKefPUZuA== X-Google-Smtp-Source: APXvYqz7tMuNcNg0ZhkFis/3EWnaP2sWZR4LwGPDiB0OtZN0B9xYTOhgQb/OmnzZMtbVi2IC9ZX67KnushV2s2HHCuw= X-Received: by 2002:a17:906:f259:: with SMTP id gy25mr29738224ejb.2.1569229261043; Mon, 23 Sep 2019 02:01:01 -0700 (PDT) MIME-Version: 1.0 References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> <87woe3otut.fsf@gnu.org> <87pnjt6dbf.fsf@gmail.com> <87d0frl8js.fsf@gnu.org> In-Reply-To: <87d0frl8js.fsf@gnu.org> From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Date: Mon, 23 Sep 2019 11:00:48 +0200 Message-ID: Subject: Re: bug#36785: Impossible to pull on foreign distro To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Content-Type: multipart/alternative; boundary="000000000000ad0be8059334a83c" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000ad0be8059334a83c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s ezt =C3=ADrta (id=C5=91pont: 2019. szep= t. 23., H=C3=A9t 10:29): > Hi Maxim, > > Maxim Cournoyer skribis: > > > --- a/doc/guix.texi > > +++ b/doc/guix.texi > > @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System! Fro= m > then on, you can update the > > system whenever you want by running, say: > > > > @example > > -guix pull > > -sudo guix system reconfigure /etc/config.scm > > +sudo -i guix pull > > +sudo -i guix system reconfigure /etc/config.scm > > @end example > > > > @noindent > > @@ -2396,14 +2396,6 @@ This builds a new system generation with the > latest packages and services > > (@pxref{Invoking guix system}). We recommend doing that regularly so > that > > your system includes the latest security updates (@pxref{Security > Updates}). > > > > -@c See < > https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00268.html>. > > -@quotation Note > > -@cindex sudo vs. @command{guix pull} > > -Note that @command{sudo guix} runs your user's @command{guix} command > and > > -@emph{not} root's, because @command{sudo} leaves @code{PATH} > unchanged. To > > -explicitly run root's @command{guix}, type @command{sudo -i guix > @dots{}}. > > -@end quotation > > I think these bits were correct. > > That is, when running =E2=80=9Csudo foo=E2=80=9D, =E2=80=9Cfoo=E2=80=9D i= s looked up in the user=E2=80=99s > $PATH, not in root=E2=80=99s $PATH. That=E2=80=99s what led to this text= in commit > 796a4491fdaa4a0a3d669457b89356f9fbfc966e. > > So this part is fine > I believe sudo -H would work in all distros for doing a root guix pull. Can someone confirm? > > Perhaps we need another section for this? Or perhaps we can drop the > ball=E2=80=A6 > > Thanks, > Ludo=E2=80=99. > Best regards, g_bor > --000000000000ad0be8059334a83c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Ludovic Court=C3=A8s <ludo@gnu.org> ezt =C3=ADrta (id=C5=91pont: 2019. szept. 23., H=C3= =A9t 10:29):
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System!= =C2=A0 From then on, you can update the
>=C2=A0 system whenever you want by running, say:
>=C2=A0
>=C2=A0 @example
> -guix pull
> -sudo guix system reconfigure /etc/config.scm
> +sudo -i guix pull
> +sudo -i guix system reconfigure /etc/config.scm
>=C2=A0 @end example
>=C2=A0
>=C2=A0 @noindent
> @@ -2396,14 +2396,6 @@ This builds a new system generation with the la= test packages and services
>=C2=A0 (@pxref{Invoking guix system}).=C2=A0 We recommend doing that re= gularly so that
>=C2=A0 your system includes the latest security updates (@pxref{Securit= y Updates}).
>=C2=A0
> -@c See <https= ://lists.gnu.org/archive/html/guix-devel/2019-01/msg00268.html>.
> -@quotation Note
> -@cindex sudo vs. @command{guix pull}
> -Note that @command{sudo guix} runs your user's @command{guix} com= mand and
> -@emph{not} root's, because @command{sudo} leaves @code{PATH} unch= anged.=C2=A0 To
> -explicitly run root's @command{guix}, type @command{sudo -i guix = @dots{}}.
> -@end quotation

I think these bits were correct.

That is, when running =E2=80=9Csudo foo=E2=80=9D, =E2=80=9Cfoo=E2=80=9D is = looked up in the user=E2=80=99s
$PATH, not in root=E2=80=99s $PATH.=C2=A0 That=E2=80=99s what led to this t= ext in commit
796a4491fdaa4a0a3d669457b89356f9fbfc966e.

So this part is fine
I believ= e sudo -H would work in all distros for doing a root guix pull. Can someone= confirm?

Perhaps we need another section for this?=C2=A0 Or perhaps we can drop the<= br> ball=E2=80=A6

Thanks,
Ludo=E2=80=99.
Best regards,<= /div>
g_bor
--000000000000ad0be8059334a83c-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 23 08:48:51 2019 Received: (at 36785) by debbugs.gnu.org; 23 Sep 2019 12:48:51 +0000 Received: from localhost ([127.0.0.1]:35316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCNlr-0001MA-Cu for submit@debbugs.gnu.org; Mon, 23 Sep 2019 08:48:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCNlp-0001Ly-Nw for 36785@debbugs.gnu.org; Mon, 23 Sep 2019 08:48:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iCNlk-0007kE-I1; Mon, 23 Sep 2019 08:48:44 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43196 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iCNlj-00057T-TT; Mon, 23 Sep 2019 08:48:44 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?G=C3=A1bor?= Boskovits Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> <87woe3otut.fsf@gnu.org> <87pnjt6dbf.fsf@gmail.com> <87d0frl8js.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 =?utf-8?Q?Vend=C3=A9miaire?= an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 23 Sep 2019 14:48:40 +0200 In-Reply-To: (=?utf-8?Q?=22G=C3=A1bor?= Boskovits"'s message of "Mon, 23 Sep 2019 11:00:48 +0200") Message-ID: <87h853jhzr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi G=C3=A1bor, G=C3=A1bor Boskovits skribis: > I believe sudo -H would work in all distros for doing a root guix pull. C= an > someone confirm? I think so, yes. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 23 10:10:06 2019 Received: (at 36785) by debbugs.gnu.org; 23 Sep 2019 14:10:06 +0000 Received: from localhost ([127.0.0.1]:36692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCP2T-00061A-PN for submit@debbugs.gnu.org; Mon, 23 Sep 2019 10:10:06 -0400 Received: from mail-pg1-f176.google.com ([209.85.215.176]:41628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCP2R-00060Z-TU for 36785@debbugs.gnu.org; Mon, 23 Sep 2019 10:10:04 -0400 Received: by mail-pg1-f176.google.com with SMTP id s1so6966601pgv.8 for <36785@debbugs.gnu.org>; Mon, 23 Sep 2019 07:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Jpm0RPVnSQtv18O7NnlbQ/xDjSgoXqQ5FOw6nhQIjXo=; b=n9ja68GZzDJfR1d5O8bRmYmiC44nyN68Qqv5oLKrRYpw4ECVP0mTTXYwUaxBXT6AHb yGTg3WGSP5jntaJrB040TCDMkuVjasHzrfdHus/UgjMr6qnrOpjzKA4l7O6kAfwHI9zD DFCP4gp2kjiNEbVoxVCS7+DngVJtzDQDCNNrB9zxZVXGu7RlJtaj22Z+/YGrQOkCedwD qFW0KdoGMmY33jz9/+O4VvfjcrlNuqIByyc5qow97vU6343nCv8865VGwBkSbUHXVZFW WuGxBwCtmSGZWey32CI4DdpuFYCnnjlP4C++qR+6Nxir2QOuwz/7RZotDZj0BMmIgxit fMRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Jpm0RPVnSQtv18O7NnlbQ/xDjSgoXqQ5FOw6nhQIjXo=; b=d/xoOKPjM1TDOabClRUY0aTh/D6Iw5qapefi4txARpyIGiGntwq+94POWKNcvTVOdT I6eriQ/mJSxyZyBZPnFgHFBxR0PLIVTHmDXmz0M0DtTG8cWukJiYbaeLj6ViQBQgbP2g Aei/VzYqYranpy3+nxWcp2CRD7QaILwxB6g7YE3WUfrBWvfW/8Cb43ylc+Q5jUqgaYaH CKY3WvHb7DR6rDsvS4QTLuOl9Ofk8Rma/B4CfsntJ24H8HYY1hH9yo8R0+o4hPbrWaHd QEdhvUqAmGB4+SjmFfiSM5U8XAzxju4MmMcBXTZPF3BruMkOkoGw1GVPMQWBEdJwq179 qGUA== X-Gm-Message-State: APjAAAVBSutRACsYqveqH6L2/IMxVtKIggzH+djWhfpEyB71fj9adPwg IxrBQxppdBvHtMBDO5H9RT0seg5y X-Google-Smtp-Source: APXvYqxOcWmzfTiphVO6Km5AmSyx7+XIiZbLCP2HhVQcAUFZ7q2z28FwlZLNUiMIKP3YNL9DNEVFgA== X-Received: by 2002:a63:184:: with SMTP id 126mr170599pgb.350.1569247797859; Mon, 23 Sep 2019 07:09:57 -0700 (PDT) Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6]) by smtp.gmail.com with ESMTPSA id e127sm11260071pfe.37.2019.09.23.07.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:09:56 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> <87woe3otut.fsf@gnu.org> <87pnjt6dbf.fsf@gmail.com> <87d0frl8js.fsf@gnu.org> Date: Mon, 23 Sep 2019 23:09:52 +0900 In-Reply-To: <87d0frl8js.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 23 Sep 2019 10:29:43 +0200") Message-ID: <871rw7f6j3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, =?utf-8?Q?G=C3=A1bor?= Boskovits X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Ludovic Court=C3=A8s writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> --- a/doc/guix.texi >> +++ b/doc/guix.texi >> @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System! From= then on, you can update the >> system whenever you want by running, say: >>=20=20 >> @example >> -guix pull >> -sudo guix system reconfigure /etc/config.scm >> +sudo -i guix pull >> +sudo -i guix system reconfigure /etc/config.scm >> @end example >>=20=20 >> @noindent >> @@ -2396,14 +2396,6 @@ This builds a new system generation with the late= st packages and services >> (@pxref{Invoking guix system}). We recommend doing that regularly so t= hat >> your system includes the latest security updates (@pxref{Security Updat= es}). >>=20=20 >> -@c See . >> -@quotation Note >> -@cindex sudo vs. @command{guix pull} >> -Note that @command{sudo guix} runs your user's @command{guix} command a= nd >> -@emph{not} root's, because @command{sudo} leaves @code{PATH} unchanged.= To >> -explicitly run root's @command{guix}, type @command{sudo -i guix @dots{= }}. >> -@end quotation > > I think these bits were correct. They are correct when applied to a Guix System; what my commits aim to do is make them generally true regardless of the Guix System vs foreign distro situation, in an attempt to negate possible confusion. It's not succeeding, obviously :-). I had modified that bit of the manual because that's apparently the only place where we mention 'sudo guix pull' in the manual. In the commit message I wrote: Although this section is specific to Guix System, it is likely to be read by users of foreign GNU/Linux distributions as well. Remove the note, given that sudo doesn't preserve the user's PATH on foreign distributions such as Debian. > That is, when running =E2=80=9Csudo foo=E2=80=9D, =E2=80=9Cfoo=E2=80=9D i= s looked up in the user=E2=80=99s > $PATH, not in root=E2=80=99s $PATH. That=E2=80=99s what led to this text= in commit > 796a4491fdaa4a0a3d669457b89356f9fbfc966e. > > So this part is fine. > > Perhaps we need another section for this? Or perhaps we can drop the > ball=E2=80=A6 Agreed, until more real use cases come so that the proper solution can be more clear (in regards to what needs to be changed in the manual). Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 24 08:37:42 2019 Received: (at 36785) by debbugs.gnu.org; 24 Sep 2019 12:37:42 +0000 Received: from localhost ([127.0.0.1]:37870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCk4c-0002Fa-IW for submit@debbugs.gnu.org; Tue, 24 Sep 2019 08:37:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCk4b-0002FO-2v for 36785@debbugs.gnu.org; Tue, 24 Sep 2019 08:37:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iCk4V-0000l4-Tn; Tue, 24 Sep 2019 08:37:35 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=41482 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iCk4U-0002i7-If; Tue, 24 Sep 2019 08:37:35 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> <87woe3otut.fsf@gnu.org> <87pnjt6dbf.fsf@gmail.com> <87d0frl8js.fsf@gnu.org> <871rw7f6j3.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 3 =?utf-8?Q?Vend=C3=A9miaire?= an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 24 Sep 2019 14:37:32 +0200 In-Reply-To: <871rw7f6j3.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 23 Sep 2019 23:09:52 +0900") Message-ID: <87d0fpkgz7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, =?utf-8?Q?G=C3=A1bor?= Boskovits X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: > >> Hi Maxim, >> >> Maxim Cournoyer skribis: >> >>> --- a/doc/guix.texi >>> +++ b/doc/guix.texi >>> @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System! Fro= m then on, you can update the >>> system whenever you want by running, say: >>>=20=20 >>> @example >>> -guix pull >>> -sudo guix system reconfigure /etc/config.scm >>> +sudo -i guix pull >>> +sudo -i guix system reconfigure /etc/config.scm >>> @end example >>>=20=20 >>> @noindent >>> @@ -2396,14 +2396,6 @@ This builds a new system generation with the lat= est packages and services >>> (@pxref{Invoking guix system}). We recommend doing that regularly so = that >>> your system includes the latest security updates (@pxref{Security Upda= tes}). >>>=20=20 >>> -@c See . >>> -@quotation Note >>> -@cindex sudo vs. @command{guix pull} >>> -Note that @command{sudo guix} runs your user's @command{guix} command = and >>> -@emph{not} root's, because @command{sudo} leaves @code{PATH} unchanged= . To >>> -explicitly run root's @command{guix}, type @command{sudo -i guix @dots= {}}. >>> -@end quotation >> >> I think these bits were correct. > > They are correct when applied to a Guix System; It=E2=80=99s a paragraph that explains how to upgrade Guix System, so I thi= nk foreign distros should be discussed elsewhere. (I appreciate your attempt to add proper documentation about that for foreign distros!) > what my commits aim to do is make them generally true regardless of > In the commit message I wrote: > > Although this section is specific to Guix System, it is likely to be > read by users of foreign GNU/Linux distributions as well. Remove the > note, given that sudo doesn't preserve the user's PATH on foreign > distributions such as Debian. But users of foreign distros would hopefully realize that =E2=80=98guix sys= tem reconfigure=E2=80=99 (in the same snippet) is not for them. :-) What about adding a section that we could call =E2=80=9CUpgrading Guix=E2= =80=9D under =E2=80=9CApplication Setup=E2=80=9D, which is where setup on foreign = distros is discussed? The section could say: 1. Run =E2=80=98guix pull=E2=80=99 to upgrade Guix. 2. When you need to upgrade the build daemon, for instance, which runs as root, run: sudo -i guix pull How does that sound? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 27 11:23:50 2019 Received: (at 36785) by debbugs.gnu.org; 27 Sep 2019 15:23:50 +0000 Received: from localhost ([127.0.0.1]:48427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDs61-0002vE-Qf for submit@debbugs.gnu.org; Fri, 27 Sep 2019 11:23:50 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:35106) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDs60-0002ut-IQ for 36785@debbugs.gnu.org; Fri, 27 Sep 2019 11:23:49 -0400 Received: by mail-pl1-f193.google.com with SMTP id y10so1239852plp.2 for <36785@debbugs.gnu.org>; Fri, 27 Sep 2019 08:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=0ihRbxNfOUYhxhp7ucfZ7eI00ORQWyEP2t0Gl+0vIZU=; b=T1Ba/aNQHfwJtKfoZVXiMkvyogD5706xfLZZvjpWxxUq+dJySY4O4wR3i+nYwygzlv pV+WxeeSilegXua2ko7SCCqqe7UkLnTkOJoiMFWEWzH8jfPaHyzxcEn3uriLwNHBpaN0 QlAfp5BVqs1MpT5mt/wY72R0nQ6qREocE6IhEnS1JKByAUFc75UEIjH07O2x6ero3xOP uSe0GMTv7mdYP1AyEyz0b3DgmQFTg1j5l0r9QY/pO6dKiGKn1EJY/CpGLtwdtREq22/m qkxplXJb2hkrg0Urg4TNFuM2KiYs+JqzfEUtlAxBP6uUeSwtJWNyJq0zXr2kiy/QXaSf 6qjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=0ihRbxNfOUYhxhp7ucfZ7eI00ORQWyEP2t0Gl+0vIZU=; b=hNA8KLnV9QfxSPGzhNcM2srQkWjmXO7Ije1xwwGuRtyiu0r79sUTPMtkexSOgYMrIB mVGZir77ScLK9LQnr+0hxiysMFoxKy1LMpRAzgMoRvR1u3UZ+dtrajFtYl+QjN8jooqj ZRF8xnYiBEEVQ/vEoPQcWNWbzUvf1dsagir3Sv+DKXGEpnurEeo6NIqI3MpTX6GnfdEk HkM9xtZrM4FX9ZXE2wdu8fKySHgy0pc6/EvRerO8q1ikALu8iuVW27CY6ITVUSs3zgT+ 684atoccbRbiaaSnTaQJJtS4vdznpY1mlhecux3J0XsEdp4pPJFhYuGsFy7L0q+7Xozz J8oQ== X-Gm-Message-State: APjAAAUEDd0zP89KmsSqSFm5lMeTPz1i3xMKjVSZnL1WjbXfx0DaRyEP fPkvzQYX2CjNeuF/fLDEo2L94dYArRM= X-Google-Smtp-Source: APXvYqw//ILSSYMz720/qTqTdbD3pG/U38fKWETOVim2aB2mklarcfFXO9kzRI7+lHJRJZ+Tv0nfSQ== X-Received: by 2002:a17:902:8ec2:: with SMTP id x2mr5088152plo.250.1569597822502; Fri, 27 Sep 2019 08:23:42 -0700 (PDT) Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6]) by smtp.gmail.com with ESMTPSA id i10sm2953608pfa.70.2019.09.27.08.23.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 08:23:38 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> <87woe3otut.fsf@gnu.org> <87pnjt6dbf.fsf@gmail.com> <87d0frl8js.fsf@gnu.org> <871rw7f6j3.fsf@gmail.com> <87d0fpkgz7.fsf@gnu.org> Date: Sat, 28 Sep 2019 00:23:34 +0900 In-Reply-To: <87d0fpkgz7.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 24 Sep 2019 14:37:32 +0200") Message-ID: <8736ghdaq1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, =?utf-8?Q?G=C3=A1bor?= Boskovits X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Ludovic Court=C3=A8s writes: [...] > It=E2=80=99s a paragraph that explains how to upgrade Guix System, so I t= hink > foreign distros should be discussed elsewhere. (I appreciate your > attempt to add proper documentation about that for foreign distros!) > >> what my commits aim to do is make them generally true regardless of >> In the commit message I wrote: >> >> Although this section is specific to Guix System, it is likely to be >> read by users of foreign GNU/Linux distributions as well. Remove the >> note, given that sudo doesn't preserve the user's PATH on foreign >> distributions such as Debian. > > But users of foreign distros would hopefully realize that =E2=80=98guix s= ystem > reconfigure=E2=80=99 (in the same snippet) is not for them. :-) I've been guilty myself of using C-s or 'i' in the manual and reading something that didn't apply to my system but *did* match my search... :-)=20 >> What about adding a section that we could call =E2=80=9CUpgrading Guix= =E2=80=9D > under =E2=80=9CApplication Setup=E2=80=9D, which is where setup on foreig= n distros is > discussed? > > The section could say: > > 1. Run =E2=80=98guix pull=E2=80=99 to upgrade Guix. > > 2. When you need to upgrade the build daemon, for instance, which runs > as root, run: > > sudo -i guix pull > > How does that sound? This sounds much simpler than attempting to twist some other section into something it wasn't really meant for ;-). I've attached a simple patch implementing the idea. Thanks for your patience! Maxim --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-doc-Add-a-Upgrading-Guix-section-to-the-Installation.patch Content-Transfer-Encoding: quoted-printable >From a289eb3fd6239287d4a802fbba69abf21604591f Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 28 Sep 2019 00:11:28 +0900 Subject: [PATCH] doc: Add a 'Upgrading Guix' section to the 'Installation' chapter. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This follows a discussion regarding issue #36785 (see: https://bugs.gnu.org/36785). * doc/guix.texi (Upgrading Guix): New section. Co-authored-by: Ludovic Court=C3=A8s --- doc/guix.texi | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 9fcce27597..45e6dfc442 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -513,6 +513,7 @@ ready to use it. * Setting Up the Daemon:: Preparing the build daemon's environment. * Invoking guix-daemon:: Running the build daemon. * Application Setup:: Application-specific setup. +* Upgrading Guix:: Upgrading Guix and its build daemon. @end menu =20 @node Binary Installation @@ -1777,6 +1778,28 @@ invoke the actual linker with this new set of argume= nts. You can instruct the wrapper to refuse to link against libraries not in the store by setting the @code{GUIX_LD_WRAPPER_ALLOW_IMPURITIES} environment variable to @code{no}. =20 +@node Upgrading Guix +@section Upgrading Guix + +@cindex Upgrading Guix, on a foreign distro + +To upgrade Guix, run: + +@example +guix pull +@end example + +@cindex Upgrading Guix for the root user, on a foreign distro +@cindex Upgrading the Guix daemon, on a foreign distro +@cindex @command{guix pull} for the root user, on a foreign distro + +When you need to upgrade the build daemon, for instance, which runs as +root, run: + +@example +sudo -i guix pull +@end example + @c TODO What else? =20 @c ********************************************************************* --=20 2.23.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 13:49:36 2019 Received: (at 36785) by debbugs.gnu.org; 28 Sep 2019 17:49:36 +0000 Received: from localhost ([127.0.0.1]:51146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEGqe-0005NZ-EQ for submit@debbugs.gnu.org; Sat, 28 Sep 2019 13:49:36 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:49016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEGqa-0005NN-8g for 36785@debbugs.gnu.org; Sat, 28 Sep 2019 13:49:34 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C41F38F7BA; Sat, 28 Sep 2019 19:49:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gEMqInDH3Gkj; Sat, 28 Sep 2019 19:49:29 +0200 (CEST) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 5E80C8F787; Sat, 28 Sep 2019 19:49:29 +0200 (CEST) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> <87woe3otut.fsf@gnu.org> <87pnjt6dbf.fsf@gmail.com> <87d0frl8js.fsf@gnu.org> <871rw7f6j3.fsf@gmail.com> <87d0fpkgz7.fsf@gnu.org> <8736ghdaq1.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 =?utf-8?Q?Vend=C3=A9miaire?= an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 28 Sep 2019 19:49:28 +0200 In-Reply-To: <8736ghdaq1.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 28 Sep 2019 00:23:34 +0900") Message-ID: <87k19sqpjr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org, =?utf-8?Q?G=C3=A1bor?= Boskovits X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi Maxim! Maxim Cournoyer skribis: > From a289eb3fd6239287d4a802fbba69abf21604591f Mon Sep 17 00:00:00 2001 > From: Maxim Cournoyer > Date: Sat, 28 Sep 2019 00:11:28 +0900 > Subject: [PATCH] doc: Add a 'Upgrading Guix' section to the 'Installation' > chapter. > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit > > This follows a discussion regarding issue #36785 (see: > https://bugs.gnu.org/36785). > > * doc/guix.texi (Upgrading Guix): New section. > > Co-authored-by: Ludovic Court=C3=A8s [...] > +@node Upgrading Guix > +@section Upgrading Guix > + > +@cindex Upgrading Guix, on a foreign distro Nitpicking: index entries are usually lower-case. > +To upgrade Guix, run: > + > +@example > +guix pull > +@end example Perhaps add: @xref{Invoking guix pull}, for more information. > +When you need to upgrade the build daemon, for instance, which runs as > +root, run: > + > +@example > +sudo -i guix pull > +@end example What about restating upfront that we=E2=80=99re talking about foreign distr= os specifically: On a foreign distro, you can upgrade the build daemon by running: @example sudo -i guix pull @end example @noindent followed by (assuming your distro uses the systemd service management tool): @example systemctl restart guix-daemon.service @end example On Guix System, upgrading the daemon is achieved by reconfiguring the system (@pxref{Invoking guix system, @code{guix system reconfigure}}). ? Feel free to push something along these lines. Thank you, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 21:36:17 2019 Received: (at 36785) by debbugs.gnu.org; 29 Sep 2019 01:36:17 +0000 Received: from localhost ([127.0.0.1]:51734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEO8H-00046f-Gd for submit@debbugs.gnu.org; Sat, 28 Sep 2019 21:36:17 -0400 Received: from mail-pg1-f179.google.com ([209.85.215.179]:43503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEO8D-00046P-IZ for 36785@debbugs.gnu.org; Sat, 28 Sep 2019 21:36:15 -0400 Received: by mail-pg1-f179.google.com with SMTP id v27so5367577pgk.10 for <36785@debbugs.gnu.org>; Sat, 28 Sep 2019 18:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=xCi2QsBmDoE644WRK3W2ju2OUa3CHiBLnBRaytPGVrE=; b=AInI66CdUnToA7RgrF+d6jN5hFnNqRejU+M4MdZ/6WqE455fIehVBwoJeqWZUJ+Q8b w05DX0wKQzi0uAhrJizi7ZR8G1xdr5aO/IogMVEnQ7KnO8SgE6ajA1LrB2Wsyy0uAS6l BzOD27nOK3u+3g3/5QNLl95iAMGdV6rruF/XHPz+2XTDYxY1cyOXtSZ+lNrMU4wwSXBV pDKqmZVaUU0KK1vv9z4cpT5Pl2BLvVsNLujpqMdI4aC5d+HmopRqmrVpTMckvxxBWQRv ZMNSJvXOLM+QBQfoBk6Qx+AXYwVyl+xw0+7VkO+PDSWvJ89X6bCU8QzvUMvawPPY3L23 IxUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=xCi2QsBmDoE644WRK3W2ju2OUa3CHiBLnBRaytPGVrE=; b=qD6tBm9DcTdzVhCx7N/YFVx5BXkWGwYEowGGpRJ1Oqd8kJjdCcJtrnY2eq04y+UDcI q1vHPLEEWRWKZQjBXpUwJZlmCTvY9sjifqJ0WLW83mT1qi6IPuRrokxvvEceJLEd6lnj FEQ0gqrGHdhl7RTECNnnDjLFU7IhjKXn6fYZF6o3H+PzQY8dy3M3AfDX3uft8+urUznw l5RyLN+kbU1SPpza1S78hFO8BNLNOZbMWfEUIssfyEecs1rledFgXNvud4wWW+samE6n CXgf4U48QtGTKL92gPtrsrvLSThlliHD+cPAeSZvI0QvzFqCr+JkQr9jFcF5EhWbmetX LmIQ== X-Gm-Message-State: APjAAAVRhWJdfmpFjfQU6d695OwFfMuZm8g8Z3Hh6YrE/xRGhmYUMHi9 lFbA3+z0dj5EJmG4DaCD2hx+jZcn X-Google-Smtp-Source: APXvYqzxmvVKHJCLFxbczy2MHl07308la4GIpcVLypsqJ7gqjkkOYLQv9uyIDDVK2WUEtW3pTns0Ug== X-Received: by 2002:a65:620a:: with SMTP id d10mr17093272pgv.8.1569720967312; Sat, 28 Sep 2019 18:36:07 -0700 (PDT) Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6]) by smtp.gmail.com with ESMTPSA id o24sm9419257pgj.41.2019.09.28.18.36.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2019 18:36:06 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36785: Impossible to pull on foreign distro References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@lepiller.eu> <874l39ra37.fsf@gnu.org> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@lepiller.eu> <87tvb9qktd.fsf@gnu.org> <87woe6fune.fsf@gnu.org> <87pnjv73sg.fsf@gmail.com> <87woe3otut.fsf@gnu.org> <87pnjt6dbf.fsf@gmail.com> <87d0frl8js.fsf@gnu.org> <871rw7f6j3.fsf@gmail.com> <87d0fpkgz7.fsf@gnu.org> <8736ghdaq1.fsf@gmail.com> <87k19sqpjr.fsf@gnu.org> Date: Sun, 29 Sep 2019 10:36:01 +0900 In-Reply-To: <87k19sqpjr.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 28 Sep 2019 19:49:28 +0200") Message-ID: <87r23zc29q.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36785 Cc: 36785@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Ludovic! Ludovic Court=C3=A8s writes: > Hi Maxim! > > Maxim Cournoyer skribis: > >> From a289eb3fd6239287d4a802fbba69abf21604591f Mon Sep 17 00:00:00 2001 >> From: Maxim Cournoyer >> Date: Sat, 28 Sep 2019 00:11:28 +0900 >> Subject: [PATCH] doc: Add a 'Upgrading Guix' section to the 'Installatio= n' >> chapter. >> MIME-Version: 1.0 >> Content-Type: text/plain; charset=3DUTF-8 >> Content-Transfer-Encoding: 8bit >> >> This follows a discussion regarding issue #36785 (see: >> https://bugs.gnu.org/36785). >> >> * doc/guix.texi (Upgrading Guix): New section. >> >> Co-authored-by: Ludovic Court=C3=A8s > > [...] > >> +@node Upgrading Guix >> +@section Upgrading Guix >> + >> +@cindex Upgrading Guix, on a foreign distro > > Nitpicking: index entries are usually lower-case. Oh! I hadn't realized this was the convention used in Guix, thanks for pointing it out. >> +To upgrade Guix, run: >> + >> +@example >> +guix pull >> +@end example > > Perhaps add: > > @xref{Invoking guix pull}, for more information. > >> +When you need to upgrade the build daemon, for instance, which runs as >> +root, run: >> + >> +@example >> +sudo -i guix pull >> +@end example > > What about restating upfront that we=E2=80=99re talking about foreign dis= tros > specifically: > > On a foreign distro, you can upgrade the build daemon by running: > > @example > sudo -i guix pull > @end example > > @noindent > followed by (assuming your distro uses the systemd service management > tool): > > @example > systemctl restart guix-daemon.service > @end example > > On Guix System, upgrading the daemon is achieved by reconfiguring the > system (@pxref{Invoking guix system, @code{guix system reconfigure}}). > > ? Great additions. > Feel free to push something along these lines. Pushed as 5510bb01e9. Thank you! Maxim From unknown Sat Jun 21 10:33:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 27 Oct 2019 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator