Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
source /etc/profile
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
Godsmacker777
Apprentice
Apprentice


Joined: 04 May 2004
Posts: 205
Location: Fenway area, Boston Massachusetts :O)

PostPosted: Mon Dec 13, 2004 9:38 pm    Post subject: source /etc/profile Reply with quote

what does the command source /etc/profile do?

I'm getting through my problems with configuring xorg. right now I have to run this command before I can test X with "X" or "startx" I know this problem is just me not really understanding what is going on. Can anyone enlighten me?


Thanks~
_________________
Why must we hear what system you're running gentoo on, especially if all you've got is a measly gig of ram or 3gHz processor?

I want to see signatures boasting 25 cpu clusters and blade severs, or a big 'ole onyx..anyone running gentoo on an onxy??
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


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

PostPosted: Mon Dec 13, 2004 9:55 pm    Post subject: Reply with quote

As the Handbook says, it sources (pulls in) the global profile.
Why ?
Well, many emerges change the profile, and normally it is only pulled in once, when you log in.
So yes, you could also log out and then log back in.
If you think it's more convenient.
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
hollerith
Apprentice
Apprentice


Joined: 21 May 2004
Posts: 204

PostPosted: Mon Dec 13, 2004 10:16 pm    Post subject: source Reply with quote

profile is a shell script. Shell scripts run in their own private environment eg variables only exist for the script. Source applies changes to the current shell/environment eg variables will be inherited by the current shell.
Back to top
View user's profile Send private message
Godsmacker777
Apprentice
Apprentice


Joined: 04 May 2004
Posts: 205
Location: Fenway area, Boston Massachusetts :O)

PostPosted: Mon Dec 13, 2004 10:35 pm    Post subject: Reply with quote

logging out and rebooting haven't changed anything. What am I doing wrong? I can only run X if I run source first. I'm still working through tweaking xorg.conf, so it isn't really a problem right now, but I know I'm just not doing this right.
_________________
Why must we hear what system you're running gentoo on, especially if all you've got is a measly gig of ram or 3gHz processor?

I want to see signatures boasting 25 cpu clusters and blade severs, or a big 'ole onyx..anyone running gentoo on an onxy??
Back to top
View user's profile Send private message
hollerith
Apprentice
Apprentice


Joined: 21 May 2004
Posts: 204

PostPosted: Wed Dec 15, 2004 12:07 am    Post subject: Reply with quote

Sorry to paraphrase but what you mean is you can only run xorg if you run /etc/profile first and keep the settings after the script ends. If you change your .profile to include whatever xorg needs in /etc/profile then you shouldn't need to run /etc/profile again after you've logged in (same environment). However, I didn't have to alter with my login script to do any of this so maybe this is just symptomatic of something else wrong. What variables do you think xorg needs - export something DISPLAY:0?
Back to top
View user's profile Send private message
rezza
Guru
Guru


Joined: 09 Apr 2003
Posts: 434
Location: Edinburgh, UK

PostPosted: Wed Dec 15, 2004 1:25 am    Post subject: Reply with quote

You could always add "source /etc/profile" as the last line of your ~/.bashrc, which forces /etc/profile to be sourced whenever you start a bash session.
_________________
screenshots
blog
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


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

PostPosted: Wed Dec 15, 2004 10:11 pm    Post subject: Reply with quote

Godsmacker777 wrote:
logging out and rebooting haven't changed anything. What am I doing wrong?

With X ? Hmm.. could be any of about a gazillion things ;-)
Really.

But first things first - getting it to run at all.
What is in your PATH after you have logged in?

Code:
echo $PATH

If /usr/X11R6/bin (or /usr/bin/X11) is not in there, you can't "run" it as a system command.
This is normally put in the profile by the X install, which is why you have to do the source bit in the first place: any changes to the profile will only take effect after you source it or after you re-login.

Godsmacker777 wrote:
I can only run X if I run source first. I'm still working through tweaking xorg.conf, so it isn't really a problem right now, but I know I'm just not doing this right.

Then compare the PATHs before and after you source the profile - that will at least tell you if that's the problem.
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
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