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?

Clodoaldo
  • 336

2 Answers2

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.

Clodoaldo
  • 336
  • 1
    As Gilles noted, there's a difference between login and non-login shells, so that non-login ones do not load /etc/profile by default, as described here: http://www.linuxfromscratch.org/blfs/view/svn/postlfs/profile.html. So it seems to depend on gdm (if it's still gdm), whether it sources "/etc/profile" or not. Try reading /etc/gdm/Xsession, it might not contains the source strings, as in https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/794315 – Boris Burkov Oct 09 '12 at 10:21