View previous topic :: View next topic |
Author |
Message |
kiss-o-matic Guru
Joined: 19 Jul 2004 Posts: 423 Location: Tokyo
|
Posted: Mon Nov 20, 2006 6:20 am Post subject: rc scripts and environment variables [SOLVED] |
|
|
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 |
|
|
HTS Guru
Joined: 20 Feb 2006 Posts: 410 Location: Bristol, UK
|
Posted: Mon Nov 20, 2006 8:24 am Post subject: |
|
|
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 |
|
|
kiss-o-matic Guru
Joined: 19 Jul 2004 Posts: 423 Location: Tokyo
|
Posted: Mon Nov 20, 2006 11:51 pm Post subject: |
|
|
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 |
|
|
kiss-o-matic Guru
Joined: 19 Jul 2004 Posts: 423 Location: Tokyo
|
Posted: Tue Nov 21, 2006 12:28 am Post subject: |
|
|
/etc/conf.d/[rcscriptname] is where they should be set. |
|
Back to top |
|
|
|