all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* XDG_... env variables in root
@ 2021-07-06 19:29 Hamzeh Nasajpour
  2021-07-06 21:22 ` Ricardo Wurmus
  0 siblings, 1 reply; 7+ messages in thread
From: Hamzeh Nasajpour @ 2021-07-06 19:29 UTC (permalink / raw)
  To: help-guix

Hi,

I've a weird issue with all `XDG_..` env paths in the `root`. These are `XDG_...` env paths in `user` and `root`, exactly are same:

```
XDG_CONFIG_DIRS=/home/hamzeh/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg:/home/hamzeh/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_MENU_PREFIX=lxqt-
XDG_DATA_HOME=/home/hamzeh/.local/share
XDG_CONFIG_HOME=/home/hamzeh/.config
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=LXQt
XDG_SESSION_TYPE=x11
XDG_CURRENT_DESKTOP=LXQt
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CACHE_HOME=/home/hamzeh/.cache
XDG_SESSION_CLASS=user
XDG_DESKTOP_PORTAL_DIR=/home/hamzeh/.guix-profile/share/xdg-desktop-portal/portals
XDG_VTNR=7
XDG_SESSION_ID=c2
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/home/hamzeh/.guix-profile/share:/run/current-system/profile/share:/home/hamzeh/.guix-profile/share:/run/current-system/profile/share:/home/hamzeh/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share
p
```

Do you have any idea? Where and how can I fix them for `root`?

Regards,


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

* Re: XDG_... env variables in root
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Wurmus @ 2021-07-06 21:22 UTC (permalink / raw)
  To: Hamzeh Nasajpour; +Cc: help-guix


Hamzeh Nasajpour <h.nasajpour@pantherx.org> writes:

> Hi,
>
> I've a weird issue with all `XDG_..` env paths in the 
> `root`. These are `XDG_...` env paths in `user` and `root`, 
> exactly are same:
>
> ```
> XDG_CONFIG_DIRS=/home/hamzeh/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg:/home/hamzeh/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg

These are doubled because something must be adding them more than 
once.  The generated etc/profile files generally augment existing 
environment variables; they don’t replace them.

> Do you have any idea? Where and how can I fix them for `root`?

I don’t know what this means?  What do you mean by “fix”?

-- 
Ricardo


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

* Re: XDG_... env variables in root
  2021-07-06 21:22 ` Ricardo Wurmus
@ 2021-07-07  7:25   ` Hamzeh Nasajpour
  2021-07-07 14:09     ` Giovanni Biscuolo
  0 siblings, 1 reply; 7+ messages in thread
From: Hamzeh Nasajpour @ 2021-07-07  7:25 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: SuarezMiguelC via

Hi Ricardo,

Thanks for your reply.


> These are doubled because something must be adding them more than 
> once.  The generated etc/profile files generally augment existing 
> environment variables; they don’t replace them.

Yes, exactly, They are doubled, but another issue is these are env variables in `root`. My main issue is why these variables in `root` point to `USER` paths?

-- 

Hamzeh Nasajpour
PantherX Team


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

* Re: XDG_... env variables in root
  2021-07-07  7:25   ` Hamzeh Nasajpour
@ 2021-07-07 14:09     ` Giovanni Biscuolo
  2021-07-07 16:33       ` Hamzeh Nasajpour
  0 siblings, 1 reply; 7+ messages in thread
From: Giovanni Biscuolo @ 2021-07-07 14:09 UTC (permalink / raw)
  To: Hamzeh Nasajpour, Ricardo Wurmus; +Cc: SuarezMiguelC via

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

Hello Hamzeh,

"Hamzeh Nasajpour" <h.nasajpour@pantherx.org> writes:

[...]

> but another issue is these are env variables in `root`. My main issue
> is why these variables in `root` point to `USER` paths?

please can you show us only the relevant parts [1] of your bash profile
(or other shell profile) for "user" and "root"?

Thanks, Gio'


[1] I mean the one setting GUIX related env variables

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

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

* Re: XDG_... env variables in root
  2021-07-07 14:09     ` Giovanni Biscuolo
@ 2021-07-07 16:33       ` Hamzeh Nasajpour
  2021-07-08  6:45         ` Hamzeh Nasajpour
  0 siblings, 1 reply; 7+ messages in thread
From: Hamzeh Nasajpour @ 2021-07-07 16:33 UTC (permalink / raw)
  To: Giovanni Biscuolo, Ricardo Wurmus; +Cc: SuarezMiguelC via

Hi Gio,

> please can you show us only the relevant parts [1] of your bash profile
> (or other shell profile) for "user" and "root"?

This is my `/etc/profile` content:

```
# Crucial variables that could be missing in the profiles' 'etc/profile'
# because they would require combining both profiles.
# FIXME: See <http://bugs.gnu.org/20255>.
export MANPATH=$HOME/.guix-profile/share/man:/run/current-system/profile/share/man
export INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info
export XDG_DATA_DIRS=$HOME/.guix-profile/share:/run/current-system/profile/share
export XDG_CONFIG_DIRS=$HOME/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg

# Make sure libXcursor finds cursors installed into user or system profiles.  See <http://bugs.gnu.org/24445>
export XCURSOR_PATH=$HOME/.icons:$HOME/.guix-profile/share/icons:/run/current-system/profile/share/icons

# Ignore the default value of 'PATH'.
unset PATH

# Load the system profile's settings.
GUIX_PROFILE=/run/current-system/profile ; \
. /run/current-system/profile/etc/profile

# Since 'lshd' does not use pam_env, /etc/environment must be explicitly
# loaded when someone logs in via SSH.  See <http://bugs.gnu.org/22175>.
# We need 'PATH' to be defined here, for 'cat' and 'cut'.  Do this before
# reading the user's 'etc/profile' to allow variables to be overridden.
if [ -f /etc/environment -a -n "$SSH_CLIENT" \
     -a -z "$LINUX_MODULE_DIRECTORY" ]
then
  . /etc/environment
  export `cat /etc/environment | cut -d= -f1`
fi

# Arrange so that ~/.config/guix/current comes first.
for profile in "$HOME/.guix-profile" "$HOME/.config/guix/current"
do
  if [ -f "$profile/etc/profile" ]
  then
    # Load the user profile's settings.
    GUIX_PROFILE="$profile" ; \
    . "$profile/etc/profile"
  else
    # At least define this one so that basic things just work
    # when the user installs their first package.
    export PATH="$profile/bin:$PATH"
  fi
done

# Prepend setuid programs.
export PATH=/run/setuid-programs:$PATH

# Arrange so that ~/.config/guix/current/share/info comes first.
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"

# Set the umask, notably for users logging in via 'lsh'.
# See <http://bugs.gnu.org/22650>.
umask 022

# Allow Hunspell-based applications (IceCat, LibreOffice, etc.) to
# find dictionaries.
export DICPATH="$HOME/.guix-profile/share/hunspell:/run/current-system/profile/share/hunspell"

# Allow GStreamer-based applications to find plugins.
export GST_PLUGIN_PATH="$HOME/.guix-profile/lib/gstreamer-1.0"

if [ -n "$BASH_VERSION" -a -f /etc/bashrc ]
then
  # Load Bash-specific initialization code.
  . /etc/bashrc
fi

```


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

* Re: XDG_... env variables in root
  2021-07-07 16:33       ` Hamzeh Nasajpour
@ 2021-07-08  6:45         ` Hamzeh Nasajpour
  2021-07-08  8:28           ` Giovanni Biscuolo
  0 siblings, 1 reply; 7+ messages in thread
From: Hamzeh Nasajpour @ 2021-07-08  6:45 UTC (permalink / raw)
  To: SuarezMiguelC via

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


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

* Re: XDG_... env variables in root
  2021-07-08  6:45         ` Hamzeh Nasajpour
@ 2021-07-08  8:28           ` Giovanni Biscuolo
  0 siblings, 0 replies; 7+ messages in thread
From: Giovanni Biscuolo @ 2021-07-08  8:28 UTC (permalink / raw)
  To: Hamzeh Nasajpour, help-guix

Hi Hamzeh,

"Hamzeh Nasajpour" <h.nasajpour@pantherx.org> writes:

[...]

> 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:

Yes, that was the issue, I was not thinking about it when I first
replied.

Regards, Gio'

[...]

-- 
Giovanni Biscuolo

Xelera IT Infrastructures


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

end of thread, other threads:[~2021-07-08  8:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2021-07-08  8:28           ` 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.