gdm didn`t read correct PATH variables

Asked by wally

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:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

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

Revision history for this message
wally (wally-yeh) said :
#2

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

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#3

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

Revision history for this message
wally (wally-yeh) said :
#4

Thanks actionparsnip, that solved my question.

Revision history for this message
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. :)

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

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