Running openSUSE LEAP 15.2 with GNOME (and Systemd), I have noticed the following behavior:
[ol]
[li]On the first GNOME login after boot, the shell configures itself as I would expect, including the proper values in the PATH environment value.[/li][ul]
[li]By this, I mean that the PATH variable includes $HOME/bin, and this reflects in any terminal session I would open. [/li][/ul]
[li]During this first boot session, I run some daemon-like processes for the user.[/li][ul]
[li]At times, I have set KillUserProcesses=no in the Logind configuration (/etc/systemd/logind.conf) [/li][li]Other times, I have used User-specific Systemd Units [/li][/ul]
[li]I log out of this GNOME session, then some time later log back in, and find that the new shell does not have the proper values in the PATH environment variable[/li][ul]
[li]The variable does not contain $HOME/bin, but instead has the value:[/li]```
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin
[LIST]
[li]Digging around, I discovered that this is the [i]PATH[/i] value for the [i]gdm[/i] user, for the Display Manager Login prompt session [/li][/ul]
[/ol]
[li]If I log out, and then kill all of the processes for the user I was using, the system loads the environment correctly again.[/li][ul]
[li]Until I kill all of the processes, from the initial login, the user has a Systemd parent process for all of the running processes, even after logout [/li][/ul]
[/LIST]
I have observed this behavior as far back as LEAP 15.0, and although I can't remember definitely, I am thinking that I did not encounter this behavior before that.
In summary, with long-running user processes, on initial login, I have the correct environment, but on subsequent logins, I have the environment from GDM.
How can I troubleshoot this and fix this the right way*?