LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do I get a script file to run automatically when linux boots? (https://www.linuxquestions.org/questions/linux-software-2/how-do-i-get-a-script-file-to-run-automatically-when-linux-boots-501050/)

kccrusher 11-12-2006 11:54 PM

How do I get a script file to run automatically when linux boots?
 
There is a script file called ipw3945d-start that has to run to enable my wireless NIC. Right now I have to manually run this everytime linux boots. How do I get this to run automatically? I tried copying the file to the /etc/rd.d/init.d directory but that did not make a difference. I have to run the file as root if that makes a difference. I am running Mandriva 2007. Any assistance will be appreciated.

KC

Simon Bridge 11-13-2006 12:12 AM

is there an /etc/rc5.d (or /etc/rc2.d if your default runlevel is 2) or /etc/init.d ?

Your script should be in /etc/init.d/ directory.
Then you have to make a symlink from your run-level directory.
Code:

cp <script-file> /etc/init.d
ln -s /etc/init.d/<scriptfile> /etc/rc.d/rc5.d/S50<scriptfile>
ln -s /etc/init.d/<scriptfile> /etc/rc.d/rc5.d/K50<scriptfile>

... for eg.

trickykid 11-13-2006 06:29 AM

If it's just a script to set parameters to connect and not to start any type of service or deamon, just put it in your rc.local startup file.

kccrusher 11-13-2006 02:38 PM

Simon,
I am pretty sure your recommendation did the trick.:)
I need to test with my wifi at home, but it seems to work with a local hotspot. I can barely maintain a signal with this hotspot, but I did get an address. Thanks for the help.

Tricky,
Thanks for your input also. I tried the recommendations in the order they were given, and the first one seems to have worked. :eek:

KC

kccrusher 11-13-2006 09:55 PM

It is confirmed. That worked great, and my wifi connects everytime linux starts now. Thanks.

KC


All times are GMT -5. The time now is 06:19 PM.