Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/profile not being sourced on user login
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
cteverett
n00b
n00b


Joined: 11 Mar 2004
Posts: 5

PostPosted: Fri Mar 12, 2004 6:48 am    Post subject: /etc/profile not being sourced on user login Reply with quote

I just installed Gentoo and I'm having a bit of trouble with my user account. Everything seems to work for root, X, Gnome, etc. But I can't bring up an xterm in my user account. I've traced it to /etc/profile not being sourced when I log in as a user. I found this out my logging is as root, 'su'ing to my user account and trying to run 'xterm' with a command not found error. If I manually source /etc/profile then my path is updated to include /usr/X11R6/bin and then 'xterm' can be found.

How do I ensure that /etc/profile is sourced on a user log in? It seems to be sourced at 'root' login.

Thanks,
-Chris
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Fri Mar 12, 2004 7:40 am    Post subject: Reply with quote

put it in ~/.bashrc
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Fri Mar 12, 2004 3:42 pm    Post subject: Reply with quote

I have this as the first line in my ~/.bashrc file. Picked it up somewhere on the forums.
Code:
[ -r /etc/profile ] && . /etc/profile



Moved from Installing Gentoo.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Fri Mar 12, 2004 5:01 pm    Post subject: Reply with quote

How are you "su"ing? My guess is you're doing something like
Code:
su username


This is fine, but doesn't do a login as username it just sets your user id. If you do
Code:
su - username

It will be as if you just logged in as username and so your path should be set up.

-P
Back to top
View user's profile Send private message
cteverett
n00b
n00b


Joined: 11 Mar 2004
Posts: 5

PostPosted: Sat Mar 13, 2004 12:33 am    Post subject: Reply with quote

I tried adding:

[ -r /etc/profile ] && . /etc/profile

to my .bashrc file but it didn't seem to have any effect. I changed it to:

source /etc/profile

and that didn't work either. But, now when I su to my user account, either way, I have a complete path. Does .bashrc only get called after the xterm is started? What gets called when the window manager starts up?

Thanks,
-Chris
Back to top
View user's profile Send private message
darksaidin
Apprentice
Apprentice


Joined: 04 Oct 2003
Posts: 150

PostPosted: Fri Apr 09, 2004 10:21 pm    Post subject: Reply with quote

padukes wrote:
How are you "su"ing? My guess is you're doing something like
Code:
su username


This is fine, but doesn't do a login as username it just sets your user id. If you do
Code:
su - username

It will be as if you just logged in as username and so your path should be set up.

-P


Thanks! A lot cleaner than sourcing /etc/profile from root's .bashrc :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum