From: "Hamzeh Nasajpour" <h.nasajpour@pantherx.org>
To: "SuarezMiguelC via" <help-guix@gnu.org>
Subject: Re: XDG_... env variables in root
Date: Thu, 08 Jul 2021 11:15:16 +0430 [thread overview]
Message-ID: <e2569619-64d6-4cf8-b557-74f193820579@www.fastmail.com> (raw)
In-Reply-To: <97dc7afd-8463-49e9-b46f-7f2688d32a58@www.fastmail.com>
Hi,
https://unix.stackexchange.com/questions/7013/why-do-we-use-su-and-not-just-su/7021#7021
>su - invokes a login shell after switching the user. A login shell resets most environment variables, providing a clean base.
>su just switches the user, providing a normal shell with an environment nearly the same as with the old user.
Seems that this is relevant to way of switching user which I used. I was using `su` for switching as `root` and just now I found that there are some differences between `su` and `su -`. With using of `su -` the `XDG_...` env paths are correct:
```
$ su -
$ printenv | grep XDG_
XDG_CONFIG_DIRS=/run/current-system/profile/etc/xdg:/root/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg
XDG_DATA_DIRS=/run/current-system/profile/share:/root/.guix-profile/share:/run/current-system/profile/share
```
Anyway I didn't know there are differences between `su` and `su -`.
Regards,
Hamzeh
next prev parent reply other threads:[~2021-07-08 6:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-06 19:29 XDG_... env variables in root Hamzeh Nasajpour
2021-07-06 21:22 ` Ricardo Wurmus
2021-07-07 7:25 ` Hamzeh Nasajpour
2021-07-07 14:09 ` Giovanni Biscuolo
2021-07-07 16:33 ` Hamzeh Nasajpour
2021-07-08 6:45 ` Hamzeh Nasajpour [this message]
2021-07-08 8:28 ` 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=e2569619-64d6-4cf8-b557-74f193820579@www.fastmail.com \
--to=h.nasajpour@pantherx.org \
--cc=help-guix@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.
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).