unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guix-devel@gnu.org
Subject: ‘sudo’ leaves PATH unchanged… so what?
Date: Thu, 17 Jan 2019 11:34:26 +0100	[thread overview]
Message-ID: <87y37jwp1p.fsf@gnu.org> (raw)

Hello Guix,

I’m not sure if this is a bug, but on Guix System, ‘sudo’ leaves PATH
unchanged:

--8<---------------cut here---------------start------------->8---
$ sudo env|grep '^PATH='|sha1sum
5236ce49c388ade7c3e8f767d8136c1c38a97c6a  -
$ env|grep '^PATH='|sha1sum
5236ce49c388ade7c3e8f767d8136c1c38a97c6a  -
--8<---------------cut here---------------end--------------->8---

I think that’s because the shell spawned by ‘sudo’ 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.

However, it trips up many people.  In particular, people are surprised
that “sudo guix system reconfigure …” does not use ~root/.config/guix,
and instead uses theirs (or /run/current-system/profile/…).

My take on this is that this is normal behavior, but that we should
maybe recommend “sudo -i guix system reconfigure …” instead of
“sudo guix system reconfigure” in the manual, and/or add a warning in
the manual.

Thoughts?

Ludo’.

             reply	other threads:[~2019-01-17 10:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 10:34 Ludovic Courtès [this message]
2019-01-17 11:03 ` ‘sudo’ leaves PATH unchanged… so what? Pierre Neidhardt
2019-01-17 11:14 ` Ricardo Wurmus
2019-01-17 12:35   ` Ludovic Courtès
2019-01-17 12:47     ` Pierre Neidhardt
2019-01-18  7:15     ` Giovanni Biscuolo
2019-01-18  7:30       ` Ricardo Wurmus
2019-01-18  8:06         ` Caleb Ristvedt
2019-01-18 11:33           ` Giovanni Biscuolo
2019-01-18 19:03             ` Caleb Ristvedt
2019-01-18 20:29               ` Danny Milosavljevic
2019-01-19  6:19                 ` swedebugia
2019-01-19 22:55                 ` Ludovic Courtès
2019-01-19 22:52           ` Ludovic Courtès
2019-01-20  2:12             ` Danny Milosavljevic
2019-01-18 10:39         ` Giovanni Biscuolo

Reply instructions:

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

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

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87y37jwp1p.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

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

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

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).