LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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

Reply
 
Search this Thread
Old 03-18-2002, 02:49 PM   #1
Chijtska
Member
 
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362

Rep: Reputation: 30
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?
 
Old 03-18-2002, 03:08 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,398

Rep: Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964
y'know.. the search part of the site DOES work...

add it to /etc/rc.local
 
Old 03-18-2002, 03:09 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,536

Rep: Reputation: 148Reputation: 148
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.
 
Old 03-18-2002, 04:14 PM   #4
Chijtska
Member
 
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362

Original Poster
Rep: Reputation: 30
acid, y'know... you dont have to answer if you dont want to...
 
Old 03-18-2002, 04:17 PM   #5
Chijtska
Member
 
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362

Original Poster
Rep: Reputation: 30
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
 
Old 03-18-2002, 04:22 PM   #6
finegan
Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 57
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
 
Old 03-18-2002, 04:26 PM   #7
Sixpax
Member
 
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386

Rep: Reputation: 30
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.
 
Old 03-18-2002, 04:41 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,398

Rep: Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964Reputation: 1964
/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.
 
Old 03-18-2002, 04:49 PM   #9
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,536

Rep: Reputation: 148Reputation: 148
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.
 
Old 03-18-2002, 04:51 PM   #10
finegan
Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 57
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
 
Old 03-18-2002, 04:54 PM   #11
Chijtska
Member
 
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362

Original Poster
Rep: Reputation: 30
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!
 
Old 03-18-2002, 05:02 PM   #12
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,536

Rep: Reputation: 148Reputation: 148
not ethernet, but dsl :-)
 
Old 03-18-2002, 05:41 PM   #13
Chijtska
Member
 
Registered: Jan 2002
Location: High Falls, GA
Distribution: Mandrake8.2, FreeBSD, Solaris
Posts: 362

Original Poster
Rep: Reputation: 30
At any rate...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with too many 'ppp' interfaces started at boot time utumno Linux - Networking 1 06-12-2005 04:11 AM
starting the script at boot time hudy_rob Mandriva 4 12-09-2004 10:29 AM
A good boot-time FSCK script? BFG-rat Linux - Software 2 04-18-2004 06:54 AM
Stop boot script at boot time!! kmiles2 Linux - Newbie 1 02-23-2004 10:04 PM
i want to run a script or program at boot time!! FreakboY Linux - Newbie 9 10-12-2003 08:03 AM


All times are GMT -5. The time now is 11:44 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration