gdm didn`t read correct PATH variables

Asked by wally on 2012-06-28

When I enter the Xfce desktop, I clicked right mouse button and choose the termianl, I enter "echo $PATH", and get return below":
/usr/local/bin:/usr/bin:/bin:/usr/games

and my /etc/environment is:
PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin:/opt/jre/bin"

and if I use ctrl + alt + F1 to switch to tty1, and enter "echo $PATH", I got:
/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin:/opt/jre/bin

I also edit /etc/gdm/gdm.conf, /etc/environment, /etc/login.defs no effect.
but when I use "startx" instead "sudo service gdm start", my $PATH will be correct.

it seems a gdm bug, I install lightdm and don`t have the bug anymore, but if I use gdm or slim instead, the problem will appear.

by the way, how do I change the login manager? when I install gdm, ubuntu 12.04 pop up a purple console, and ask me which manager to use, how do I wake this this purple console again?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gdm Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
2012-06-28
Last query:
2012-06-28
Last reply:
2012-06-28

I suggest you add the path variable in ~/.bashrc and it will apply to any DE.

wally (wally-yeh) said : #2

but if I modified /etc/environment, it should effect all user, right?

You can add it in /etc/bash.bashrc too

wally (wally-yeh) said : #4

Thanks actionparsnip, that solved my question.

wally (wally-yeh) said : #5

so is /etc/environment been abandoned ? if it is, I have to rewrite my program. but thanks, your advise is lots helpful. :)

Not sure, /etc/bash.bashrc is the global bash file for all users.