On Thu, Aug 22, 2019 at 07:07:08PM +0000, Vipul wrote:
> To know who actually reads ~/.profile I've set an environment variable
> "SHELL_PRO" by adding `export SHELL_PRO=$(echo $0)` line in ~/.profile
> file then re-login and typed following command in gnome-terminal
> 
> $ echo "$SHELL_PRO"
> /etc/gdm3/Xsession

Cool.  You can start reading stuff in and around there, to try to figure
out how a gdm3 login with this particular session type works.

> > It's also possible that something else is explicitly dotting in ~/.profile. 
> >  
> I think it's not. Here is my ~/.profile file:
> https://salsa.debian.org/snippets/314

That doesn't tell you who's dotting in ~/.profile.  But apparently you
found that out using your SHELL_PRO variable trick.

> Systemd reads /etc/environment and files present in /etc/environment.d/
> folder.

I covered this elsewhere in the thread.  It's technically true that some
part of systemd reads these files, but the contents of those files do
not appear in user login environments, ever.  At least not due to anything
that systemd does.

PAM reads /etc/environment and this causes the variables in THAT FILE
ONLY to appear in user login environments.  That has nothing to do
with systemd.

Systemd also reads that file, and populates "the environment exported
by the systemd user instance to the services it starts".  This does not
include login sessions.

Reply via email to