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?
|
y'know.. the search part of the site DOES work...
add it to /etc/rc.local |
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.
|
acid, y'know... you dont have to answer if you dont want to...
|
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
|
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 |
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.
|
/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. |
Quote:
|
Quote:
Cheers, Finegan |
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! |
not ethernet, but dsl :-)
|
At any rate...
|
All times are GMT -5. The time now is 08:42 AM. |