How to set variable permanently in rc.local(RH7.3)?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
My guess is that /etc/profile.local is not loaded at bootup, but rather loaded when the use logs in. Evidence: /etc/profile.local is outside of the rc script directory. /etc/profile.local suggests they don't want you touching the real /etc/profile.
but hey, I'm guessing, a quick google search didn't tell me what I wanted to know in regards to SuSE's init scripts. thumb through them, or better do a grep for profile.local in them
or just wait for someone who knows something about SuSE to come on and tell me I'm an idiot
Right! SuSe's profile.local works in etc/ directory and
may be loaded in time of login,
but what a difference ? Login time, boot time?
Anywhere those scripts use same bush commands.
Why in one case bush command works in other case
not completely works?
well first let me give you a run down on the boot process of Linux.
|-BIOS hands off control to LILO
|-LILO passes control to the Linux Kernel
|-Kernel runs INIT as PID1
|-Runs rc files for correct runlevel example runlevel3
|-runs login programs (generically 6 on most distros)
|-Login program sets enviroment (/etc/profile)
When init is playing with the rc files, setting bash works, it just isn't carried over because there is really no "global" namespace for enviromental variables as such. rc.local does not call the login program, rather, init does.
rc.local can set variables that programs it calls can see and use, however since it isn't running the login programs the variables aren't passed down. Each time you run a shel, it has it's own enviromental variable set. Setting foo on terminal 2 won't change the enviromental variable set of terminal 1. This is generally considered a Good Thing (imagine a multi-user system).
Shell variables are inherited from the parent shell, if you su from your normal shell your foo variable will still be there.
What is happening is rc.local is a dead end in terms of progression, it is run, calls whatever programs you want, then dies (thereby loosing its enviromental variables) and returns control back to init.