GNOME logins dont run .bash_profile in RHEL7
Here's the second of my hopefully-simple questions I hope someone can easily answer. Unlike in 6.5, GNOME does not source the ~/.bash_profile when logging on at the GUI. This results in a user's PATH being inconsistent between logging on at the GUI and ssh-ing. I can't seem to find a key in login-screen or anywhere else that I can tell the display manager to source the .bash_profile. (I dont want to set the terminal to do it - .bash_profile has items that should be run once, not once per subshell.)
Anyone know if there is a setting somewhere that makes gdm source the file as it did in 6.5?
I checked on a second system and it IS sourcing the file. Again, anyone know where this feature might be set so that I can check this? Thanks.
Responses
Hi Greg,
The ~/.bash_profile
file is (should) only be sourced when Bash is started in interactive, login mode. When you're logging in graphically (using GDM or other display manager), the script that launches the session sources the ~/.profile
file. So you can use that one.
I just checked on a RHEL7 machine, and the ~/.bash_profile
file really isn't sourced by GDM, so it's strange that it'd be 'fixed' as you've added. In any case, should you need it, you can add a command to source any file you want to the /etc/X11/xinit-xinitrc-common
file (which is where you can find the command that sources ~/.profile
by default).