I recently switched from terminal prompt login (getty?) to GNOME Display Manager. It seems that GDM always reads .profile, regardless of user's setting of login shell (Zsh in my case). Why is that? I assume it's hardcoded in their source, but I can't find. Why did they do that? Does the software depends on some functionality of Bourne shell?
This is not very good if I want to use both GDM and getty (as fallback), because I then need to keep my .profile and .zprofile in sync. I'm not so confident about sourcing .profile in .zprofile (I met some compatibility issues before, when I tried to source .bashrc in .zshrc). I think Bash called as /bin/sh behaves in POSIX mode, but I'm not sure whether it avoids all the pitfalls.
In case it matters, I'm on latest Arch Linux, running GNOME with Wayland (so there should not be any Xsession script involved).
/bin/sh). – tripleee Apr 23 '17 at 09:48.profilein Debian. – Franklin Yu Apr 21 '20 at 04:58