LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to run a bash script before startup (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-run-a-bash-script-before-startup-697367/)

alirezan1 01-14-2009 07:33 PM

how to run a bash script before startup
 
Hi guys,

I need to run a bash script at the startup before anything else is up. This file exports some important global variables for some other scripts that are supposed to come up after.

I tried rc.local but it doesn't work...after the command line is up, I can't execute the scripts because the configurations are not properly exported...
I don't want to use /etc/profile as it waits for bash to come up first before it can export the configs and I can't wait that long...

Any ideas?

Thanks

yzhong 01-14-2009 08:45 PM

Did you try /etc/inittab or rc.sysinit?
(rc.local normally run after all the other init scripts)

yzhong 01-14-2009 08:45 PM

...

your_shadow03 01-14-2009 09:51 PM

Put the script into the last line:

/etc/rc.d/rc.local


All times are GMT -5. The time now is 10:26 AM.