PATH inconsistency in EL7

Wednesday , 30, April 2014 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 Comments
  • iTellion says:

    Oh,Good

  • Ferry says:

    this is also present on Fedora 20

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

  • PhilNC says:

    Fedora 20 has issue, Fedora 19 is clean.

  • Nazeem says:

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

  • river4321 says:

    in fedora 20 ,you should always “source .cshrc”, i’m crazy….

  • Please give us your valuable comment

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

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>