Comment 5 for bug 1832675

Revision history for this message
Piotr Martycz (pmartycz) wrote :

I can confirm it did work for some time but has regressed lately in 20.04.

The snap paths are missing from environment when login shell is /usr/bin/fish

pmart@t420 ~> systemctl show-environment --user | grep -e '^PATH' -e '^XDG_DATA'
PATH=/home/pmart/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
XDG_DATA_DIRS=/usr/share/plasma:/usr/local/share/:/usr/share/

After changing it to /usr/bin/bash and relogging

pmart@t420:~$ systemctl show-environment --user | grep -e '^PATH' -e '^XDG_DATA'
PATH=/home/pmart/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
XDG_DATA_DIRS=/usr/share/plasma:/usr/local/share:/usr/share:/var/lib/snapd/desktop

Applies to both sddm and login(1) sessions.

I tried to investigate further. It seems PATH for user sessions is now set by

1. systemd-environment-d-generator based on /etc/environment and its own config
2. pam_env.so module based on /etc/environment and optionally ~/.pam_environment (overrides above?)
3. some other source where ~/.local/bin path is coming from

Btw my /etc/environment contents are

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

and I'm not sure whether I have configured it explicitly or this is the default (file is not owned by any package)