all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ‘sudo’ leaves PATH unchanged… so what?
@ 2019-01-17 10:34 Ludovic Courtès
  2019-01-17 11:03 ` Pierre Neidhardt
  2019-01-17 11:14 ` Ricardo Wurmus
  0 siblings, 2 replies; 16+ messages in thread
From: Ludovic Courtès @ 2019-01-17 10:34 UTC (permalink / raw)
  To: guix-devel

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’.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-01-20  2:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 10:34 ‘sudo’ leaves PATH unchanged… so what? Ludovic Courtès
2019-01-17 11:03 ` 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

Code repositories for project(s) associated with this external index

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

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