Linux – /etc/profile not being sourced at login


I'm having a bit of an issue: Neither of my /etc/profile or /etc/environment are getting sourced at login!

i.e: After boot, the global variables I've got set in /etc/profile (and /etc/profile.d/*.sh consequently) or /etc/environment are not recognized neither by other GUI apps nor by bash on terminal.

Please note that I'm running Linux Mint 17 the Cinnamon edition, which, by default, does source the /etc/profile file.

File permissions are -rw-r--r-- 1 root root for all of the files in question.

What could be the problem?

Best Answer

Ran into this with Debian Jessie + Cinnamon + lightdm.

Going backto wheezy, I find that /etc/profile and ~/.profile gets sourced by /etc/gdm/Xsession. This logic appears to be totally missing in "this" jessie setup. So I grabbed this code and copied to a new file in jessie:


graeme@jessie:~/Desktop$ cat /etc/X11/Xsession.d/70fix_lightdm_gpv

# GPV: 2-May-2015, lightdm + cinnamon forgets to source ANY profiles!!

# First read /etc/profile and .profile
test -f /etc/profile && . /etc/profile
test -f "$HOME/.profile" && . "$HOME/.profile"
# Second read /etc/xprofile and .xprofile for X specific setup
test -f /etc/xprofile && . /etc/xprofile
test -f "$HOME/.xprofile" && . "$HOME/.xprofile"

# Local Variables:
# mode: shell-script
# sh-indentation: 2
# indent-tabs-mode: nil
# End:

# vim:set ai et sts=2 sw=2 tw=80: