LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How Do I Have a script started at boot time? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-have-a-script-started-at-boot-time-16535/)

Chijtska 03-18-2002 03:49 PM

How Do I Have a script started at boot time?
 
I have a *.sh file that I would like to have started at boot up time... its called go.sh-- how do i go about doing that?

acid_kewpie 03-18-2002 04:08 PM

y'know.. the search part of the site DOES work...

add it to /etc/rc.local

Mara 03-18-2002 04:09 PM

You've got the whole /etc/rc.d for it. It just depends when you'd like the script to be started. The easies way will be to start it from /etc/rc.local. At the beggining of this file, give a command as you'd to to start it on a console. And it's done.

Chijtska 03-18-2002 05:14 PM

acid, y'know... you dont have to answer if you dont want to...

Chijtska 03-18-2002 05:17 PM

Mara: if youre doing it in -local how will that affect a command that i run as root? before anyone asks i have no desire to run it as a user... the script is go.sh -- i use it to connect my dsl modem to the internet... it has no user permissions to run

finegan 03-18-2002 05:22 PM

The file is actually /etc/rc.d/rc.local, well at least it is on Mandrake and most of the others. Just a line that has:

./whatever/go.sh

pppoe? Bellsuck? I've got 2 machines using rc.local for this.

Cheers,

Finegan

Sixpax 03-18-2002 05:26 PM

Even though it's more work, I would use the /etc/rc.d/init.d directory for this and create a link in the proper /etc/rc.d/rc?.d directory. After all, that's what it's there for.

acid_kewpie 03-18-2002 05:41 PM

/etc/rc.local is normally just a symlink to rc.d it's quicker to type.. :D

either way rc.local is executed after all otherscripts in the rc?.d directory has run out, it only get's run once.

Mara 03-18-2002 05:49 PM

Quote:

Originally posted by Chijtska
Mara: if youre doing it in -local how will that affect a command that i run as root? before anyone asks i have no desire to run it as a user... the script is go.sh -- i use it to connect my dsl modem to the internet... it has no user permissions to run
You don't need any permissions. It's a boot script! Just type it inside. If it's executable for root it will go.

finegan 03-18-2002 05:51 PM

Quote:

Originally posted by acid_kewpie
/etc/rc.local is normally just a symlink to rc.d it's quicker to type.. :D

No kidding? I've got to start fiddling with RH and Mandy more, I'm loosing touch.

Cheers,

Finegan

Chijtska 03-18-2002 05:54 PM

finegan: yep-- bellsuck! nice moniker for it-- it has to be the world's worst isp (at least for dsl) there could possibly be...

some days it stays up until it renews the ip lease but most of the time it goes offline every hour or so and sometimes even more frequent like every 10 minutes... i know-- i have a b.s. website and probably no one checks it out and i dont get always get a lot of email on my mail server but id like for it to stay up more frequently...

i have a script for a reconnection--which, btw is not as easy as restarting pppd(you also actually have to rmmod uhci and wait a few sec's and then modprobe uhci again) but i really wish there was a script i could run in the background that checks if my computer is still connected and then if its not it will run my re.sh (restart connection script) for me and keep my offline time to a minimum...if anyone knows of such a script lemme know--ahh what am i saying--all you geeks have ethernet dsl modems haha...

anyways-- thanks to all for the help!

Mara 03-18-2002 06:02 PM

not ethernet, but dsl :-)

Chijtska 03-18-2002 06:41 PM

At any rate...


All times are GMT -5. The time now is 10:36 PM.