PATH inconsistency in EL7

Wednesday, 30, April 2014 Jim Perrin General 6 Comments

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).

 

 

#!/bin/bash
# Fix broken nautilus-open-terminal
if ! echo ${PATH} | /bin/grep -q $HOME/bin ; then
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
fi

 

 

6 thoughts on "PATH inconsistency in EL7"

  1. iTellion says:

    Oh,Good

  2. Ferry says:

    this is also present on Fedora 20

  3. PhilNC says:

    Yep, good catch. My Fedora 19 test machine has the same problem. Looks like a regression from Fedora 19, which does the right thing.

  4. PhilNC says:

    Fedora 20 has issue, Fedora 19 is clean.

  5. Nazeem says:

    Guys is it possible to migrate squid proxy config from Fedora to Centos

  6. river4321 says:

    in fedora 20 ,you should always "source .cshrc", i'm crazy....

Leave a Reply

Your email address will not be published. Required fields are marked *