Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rc scripts and environment variables [SOLVED]
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
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Mon Nov 20, 2006 6:20 am    Post subject: rc scripts and environment variables [SOLVED] Reply with quote

I assumed rc-scripts would read environment variables (system-wide ones defined in /etc/env.d) but indeed, they are not. Is there some fundamental thing about rc scripts I'm missing?

Last edited by kiss-o-matic on Tue Nov 21, 2006 2:47 am; edited 1 time in total
Back to top
View user's profile Send private message
HTS
Guru
Guru


Joined: 20 Feb 2006
Posts: 410
Location: Bristol, UK

PostPosted: Mon Nov 20, 2006 8:24 am    Post subject: Reply with quote

The action of reading environment variables is done by 'source'. You can source any file containing environment variables.
The profile is sourced at every boot or manually by 'source /etc/profile'

FYI:
/etc/profile wrote:
for sh in /etc/profile.d/*.sh ; do
if [ -r "$sh" ] ; then
. "$sh"
fi
done


If you modify them you need 'env-update' first.
_________________
Plasma desktop on Core i7 8086K OC @ 5GHz, 64GB DDR4, 2 x M.2 Samsung 970 PRO 1TB SSDs
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Mon Nov 20, 2006 11:51 pm    Post subject: Reply with quote

Right, but assuming that I either reboot, or source /etc/profile, my rc script should read any system-wide environment variable, right? They are indeed not.

I looked at the ntp rc script. It has arguments stored in $NTPD_OPTS. I checked all the scripts in /etc/env.d, and none of them set this. AFAIK, they're unique to the NTPD user.
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 423
Location: Tokyo

PostPosted: Tue Nov 21, 2006 12:28 am    Post subject: Reply with quote

/etc/conf.d/[rcscriptname] is where they should be set.
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