Learn about Centmin Mod LEMP Stack today
Register Now

PATH inconsistency in EL7

Discussion in 'CentOS, Redhat & Oracle Linux News' started by eva2000, Jun 13, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    1:44 AM
    Nginx 1.25.x
    MariaDB 10.x
    With the default gnome3 desktop in el7, opening a terminal via the menu sometimes presents the user with a different PATH variable than if they right click the desktop and choose ‘Open in Terminal’.For some reason it appears that the user’s .bash_profile is not always read, which means ~/bin and ~/.local/bin are sometimes missing from the $PATH. I’ve not been able to determine exactly what’s causing this, but it can be incredibly frustrating. Sometimes a reboot works, sometimes not. This issue is not always present, which makes it a joy to try to narrow down. The interim solution is done per user via .bashrc, or you can drop the following snippet into /etc/profile.d/consistent-user-path.sh (with 644 permissions of course).

    # Fix broken nautilus-open-terminal
    if ! echo ${PATH} | /bin/grep -q $HOME/bin ; then
    export PATH

    Continue reading...