Linux - General This 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. |
Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-18-2002, 02:49 PM
|
#1
|
Member
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362
Rep:
|
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?
|
|
|
03-18-2002, 03:08 PM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
y'know.. the search part of the site DOES work...
add it to /etc/rc.local
|
|
|
03-18-2002, 03:09 PM
|
#3
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
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.
|
|
|
03-18-2002, 04:14 PM
|
#4
|
Member
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362
Original Poster
Rep:
|
acid, y'know... you dont have to answer if you dont want to...
|
|
|
03-18-2002, 04:17 PM
|
#5
|
Member
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362
Original Poster
Rep:
|
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
|
|
|
03-18-2002, 04:22 PM
|
#6
|
LQ Guru
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700
Rep:
|
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
|
|
|
03-18-2002, 04:26 PM
|
#7
|
Member
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386
Rep:
|
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.
|
|
|
03-18-2002, 04:41 PM
|
#8
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
/etc/rc.local is normally just a symlink to rc.d it's quicker to type..
either way rc.local is executed after all otherscripts in the rc?.d directory has run out, it only get's run once.
|
|
|
03-18-2002, 04:49 PM
|
#9
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
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.
|
|
|
03-18-2002, 04:51 PM
|
#10
|
LQ Guru
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700
Rep:
|
Quote:
Originally posted by acid_kewpie
/etc/rc.local is normally just a symlink to rc.d it's quicker to type..
|
No kidding? I've got to start fiddling with RH and Mandy more, I'm loosing touch.
Cheers,
Finegan
|
|
|
03-18-2002, 04:54 PM
|
#11
|
Member
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362
Original Poster
Rep:
|
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!
|
|
|
03-18-2002, 05:02 PM
|
#12
|
Moderator
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696
|
not ethernet, but dsl :-)
|
|
|
03-18-2002, 05:41 PM
|
#13
|
Member
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362
Original Poster
Rep:
|
At any rate...
|
|
|
All times are GMT -5. The time now is 03:30 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|