From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: =?utf-8?B?4oCYc3Vkb+KAmQ==?= leaves PATH =?utf-8?Q?unchanged?= =?utf-8?Q?=E2=80=A6?= so what? Date: Thu, 17 Jan 2019 13:35:11 +0100 Message-ID: <87r2dbv4w0.fsf@gnu.org> References: <87y37jwp1p.fsf@gnu.org> <87h8e7h6yd.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:42506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gk6vR-0000r7-Hj for guix-devel@gnu.org; Thu, 17 Jan 2019 07:37:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gk6tM-00053d-NA for guix-devel@gnu.org; Thu, 17 Jan 2019 07:35:30 -0500 Received: from hera.aquilenet.fr ([2a0c:e300::1]:58024) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gk6tK-0004wH-3D for guix-devel@gnu.org; Thu, 17 Jan 2019 07:35:28 -0500 In-Reply-To: <87h8e7h6yd.fsf@elephly.net> (Ricardo Wurmus's message of "Thu, 17 Jan 2019 12:14:18 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel@gnu.org Ricardo Wurmus skribis: > Ludovic Court=C3=A8s writes: > >> Hello Guix, >> >> I=E2=80=99m not sure if this is a bug, but on Guix System, =E2=80=98sudo= =E2=80=99 leaves PATH >> unchanged: >> >> --8<---------------cut here---------------start------------->8--- >> $ sudo env|grep '^PATH=3D'|sha1sum >> 5236ce49c388ade7c3e8f767d8136c1c38a97c6a - >> $ env|grep '^PATH=3D'|sha1sum >> 5236ce49c388ade7c3e8f767d8136c1c38a97c6a - >> --8<---------------cut here---------------end--------------->8--- >> >> I think that=E2=80=99s because the shell spawned by =E2=80=98sudo=E2=80= =99 is not a login shell, >> so ~root/.bash_profile and other files that define/modify environment >> variables are not sourced. So I think this is expected behavior. > > Yes, this is expected and desired behaviour. Sysadmins generally use > =E2=80=9Csu -=E2=80=9D or =E2=80=9Csudo -i=E2=80=9D to get a =E2=80=9Cpro= per=E2=80=9D root login shell because of this. OK. >> However, it trips up many people. In particular, people are surprised >> that =E2=80=9Csudo guix system reconfigure =E2=80=A6=E2=80=9D does not u= se ~root/.config/guix, >> and instead uses theirs (or /run/current-system/profile/=E2=80=A6). >> >> My take on this is that this is normal behavior, but that we should >> maybe recommend =E2=80=9Csudo -i guix system reconfigure =E2=80=A6=E2=80= =9D instead of >> =E2=80=9Csudo guix system reconfigure=E2=80=9D in the manual, and/or add= a warning in >> the manual. > > Why would we want to recommend the use of the root user=E2=80=99s install= ation > of Guix, though? I usually don=E2=80=99t care at all about the root user= =E2=80=99s > Guix. Yeah, you=E2=80=99re right. I think the main reason would be this bit in the manual: --8<---------------cut here---------------start------------->8--- @cindex upgrading GuixSD >From then on, you can update GuixSD whenever you want by running @command{g= uix pull} as @code{root} (@pxref{Invoking guix pull}), and then running @command{guix system reconfigure /etc/config.scm}, as @code{root} too, to --8<---------------cut here---------------end--------------->8--- To many, this translates to: sudo guix pull sudo guix system =E2=80=A6 =E2=80=A6 which doesn=E2=80=99t do what one might think before =E2=80=9Csud= o guix pull=E2=80=9D updates root=E2=80=99s =E2=80=98guix=E2=80=99 whereas =E2=80=9Csudo guix system=E2= =80=9D uses the user=E2=80=99s =E2=80=98guix=E2=80=99. Either we should rephrase it or perhaps explicitly write: From then on, you can update GuixSD whenever you want by running: @example guix pull sudo guix system reconfigure /etc/config.scm @end example WDYT? Ludo=E2=80=99.