Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$PATH from .profile not available in X11 session since 3.2-beta4 on Ubuntu 22.04 #1042

Open
2 of 3 tasks
peterrus opened this issue Aug 15, 2024 · 5 comments
Open
2 of 3 tasks
Labels
bug Something isn't working

Comments

@peterrus
Copy link

peterrus commented Aug 15, 2024

Describe the bug
This might be a complex one: $PATH changes made in .profile are not reflected in either i3 or sway sessions when running 3.2-beta4 on Ubuntu 22.04.

Ubuntu ships by default with a ~/.profile that adds ~/.local/bin to your path when that directory exists. By putting a log statement in .profile I can verify that the file is indeed sourced at session startup but once I've opened a terminal (default Gnome terminal with bash) the $PATH variable does not contain ~/.local/bin even though systemctl --user show-environment | egrep ^PATH= does show it (not sure if that is relevant, but something I noticed).

I have done extensive testing on clean Ubuntu installs (test results below) to verify that this problem only occurs on Ubuntu 22.04 + Regolith 3.2-beta4 (I have not tested earlier beta's for this release).

  • All installs of Ubuntu are minimal installs through the graphical installer and then fully apt-updated.
  • All installs of Regolith are done as described here: https://regolith-desktop.com/docs/using-regolith/install/ with the following package set: regolith-desktop regolith-session-flashback regolith-look-lascaille regolith-session-sway.
has issue?
22.04+3.1 no
22.04+3.2-beta4 yes
24.04+3.2-beta4 no

To Reproduce

  • Do clean minimal install of Ubuntu 22.04 through graphical install
  • Login using Gnome
  • mkdir -p ~/.local/bin && echo "working" > ~/.local/bin/testscript && chmod +x ~/.local/bin/testscript
  • Install Regolith as described above using this repo.
  • Reboot
  • Start Regolith X11 session
  • attempt to run testscript in terminal (it is not found).

Expected behavior

  • Whatever gets sourced in ~/.profile should be present in the graphical session (X11, but preferably also Sway/wayland as the Ubuntu Gnome Wayland session also works as expected). This worked fine on Regolith 3.1.

Configuration file(s)
Clean install of regolith on a clean fully updated minimal install of Ubuntu 22.04 so no custom configuration.

Installation Details

Additional context
I have seen #958 but I am also seeing the behavior described above on the X11 session.

@peterrus peterrus added bug Something isn't working needs-triage Any bug that requires classification by a contributor labels Aug 15, 2024
@kgilmer kgilmer removed the needs-triage Any bug that requires classification by a contributor label Aug 18, 2024
@kgilmer
Copy link
Member

kgilmer commented Aug 18, 2024

@peterrus , thank you for providing the very detailed bug report.

Whatever gets sourced in ~/.profile should be present in the graphical session (X11, but preferably also Sway/wayland as the Ubuntu Gnome Wayland session also works as expected). This worked fine on Regolith 3.1.

I'm puzzled as to what might be creating this specific behavior on jammy alone. The package responsible for starting a Regolith session (regolith-session) runs the same code on both Jammy and Noble. I am running Regolith 3.2 beta 4 on Debian testing and see elements in my path that seem to have been set by my ~/.profile file.

There is some code in the sway init that does some env variable handling, but the X11 version does not do anything about this. Unclear based on your testing notes where the rootcause may be. I am unaware of anything in Regolith that handles ~/.profile directly.

@peterrus
Copy link
Author

peterrus commented Aug 19, 2024

Interesting, thanks for your reply! Since I switched to 24.04 this is no longer a problem for me but maybe interesting to keep this issue as documentation for other users that run into this problem.

By the way, I think this isn't a .profile-related thing perse, since that always gets sourced. But something related to setting the $PATH for a session. But that's all I have at the moment ;)

@chrisgavin
Copy link

I'm seeing similar behavior, also on Regolith 3.2 on jammy. It's really odd.

After logging in, I start a terminal. I can see all the environment variables set by my .profile script except for PATH which has been reset to a default value.

If I open a new tab in the same gnome terminal, suddenly PATH is set correctly in this second terminal tab. Even more weirdly, I've verified that the .profile script is not executed upon opening the second tab, so somehow it's just inheriting a different set of environment variables.

@chrisgavin
Copy link

Looking a bit further, I think I've managed to "fix" it. The solution was to delete /etc/environment, which is apparently being loaded after my user profile somewhere and resetting the path.

Possibly there are side effects to this and I will end up with many regrets later, but for now I am happy. 😅

@333fred
Copy link

333fred commented Jan 8, 2025

@chrisgavin that workaround solved it for me as well. I guess for now I'm renaming /etc/environment and sourcing it in my .profile to make sure that it's still included, but not at my expense.

333fred added a commit to 333fred/dotfiles that referenced this issue Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants