Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PATH is not changeable
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
Ghostryder
Apprentice
Apprentice


Joined: 10 Dec 2003
Posts: 216

PostPosted: Thu Jun 02, 2005 6:44 am    Post subject: PATH is not changeable Reply with quote

Hi,

I wanted to change the path for user root. So I added the additional part in /etc/profile. It looks now like this:

if [ `/usr/bin/whoami` = 'root' ]
then
# Do not set PS1 for dumb terminals
if [ "$TERM" != 'dumb' ] && [ -n "$BASH" ]
then
export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'
fi
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/opt/sun-jdk-1.5.0.03/bin:${ROOTPATH}"

But this doesn't have any effect. The Path-Variable is always the same. So I set it in the .bashrc-File and that worked. Why doesn't this have
any effect when changing in /etc/profile?

thanks, g.
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Thu Jun 02, 2005 7:22 am    Post subject: Reply with quote

Quote:
this doesn't have any effect

Then you didn't source the profile afterwards.

You should not generally have to make changes to /etc/profile to add system paths - use /etc.env.d/ for this.
There should be a ROOTPATH entry for sunjdk in there.
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
Ghostryder
Apprentice
Apprentice


Joined: 10 Dec 2003
Posts: 216

PostPosted: Thu Jun 02, 2005 7:27 am    Post subject: Reply with quote

Yes, there is a path for Java there.

I made a

env-update && source /etc/profile

and afterwards it worked. But the next time I invoked a shell, the old problem is still here...
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Thu Jun 02, 2005 8:10 am    Post subject: Reply with quote

Quote:
the next time I invoked a shell

Is this in a console, or in X as a regular user?
If the latter, you have to start the shell with root's environment; use
Code:
su -

to do this.
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
Ghostryder
Apprentice
Apprentice


Joined: 10 Dec 2003
Posts: 216

PostPosted: Thu Jun 02, 2005 8:20 am    Post subject: Reply with quote

Thanks a lot.
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