1

I have this in /etc/profile in Fedora 17:

PATH=$PATH:"/usr/pgsql-9.2/bin"
EDITOR="/usr/bin/emacs -nw"
PSQL_EDITOR="/usr/bin/emacs"
PAGER="/usr/bin/less"

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL EDITOR PSQL_EDITOR PAGER

The $PATH variable concatenation is in effect when I login as root or as postgres but not when I login to my account. I'm using terminator.

As root:

# echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.2/bin:/root/bin

As postgres:

$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/pgsql-9.2/bin:/usr/pgsql-9.2/bin

In my account:

$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/cpn/.local/bin:/home/cpn/bin

Notice the absence of the /usr/pgsql-9.2/bin path.

/home/cpn/.bash_profile has this line:

PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH

When I su - (notice the -) to my account the path is there so I guess it is a matter of login vs not login shell.

How to make the terminal to always open a login shell?

  • Most, but not all, login methods read /etc/profile. How do you log in? If you use a graphical display manager (a program where you type your password in graphics mode), which one (e.g. gdm, kdm, lightdm, …)? – Gilles Oct 8 '12 at 23:46
  • @Gilles I'm using Terminator. Edited the question to add it. – Clodoaldo Oct 9 '12 at 0:03
  • Terminator is a terminal emulator in which you can run a shell. How do you log in (i.e. where do you type your username and password)? – Gilles Oct 9 '12 at 0:06
  • @Gilles I login to Cinnamon. I guess it uses gdm. – Clodoaldo Oct 9 '12 at 0:52
  • @Clodoaldo If you need to have the path set, why not try to simply include . /etc/profile as the first line of your .bash_profile? – Karlson Oct 9 '12 at 13:33
2

If you want the directory in your PATH for all sessions, you could add it to /etc/environment. Be careful if you do that though - if you screw up the PATH in /etc/environment there's a chance that your system will not boot anymore.

1

Don't know if this is the correct fix. I did check Run command as a login shell in terminator -> profiles -> Command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.