LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-13-2005, 02:06 PM   #1
berrance
Member
 
Registered: Aug 2004
Location: Hull - England
Distribution: Ubunto and slowly switching to debian
Posts: 308

Rep: Reputation: 30
startup script order


i am having trouble with a piece of software that starts on boot, the problem is i doesnt work unless if i stop it and then restart it again once the machine is up and running. what i was wundering is if i could change the order in which things start up?

i am just looking in my /etc/init.d/rc3.d/rc5.d and each scrip has a K or S and then a number befor it i was wundering if this number is the order in which things are started. the number in fron of it is s16 i was wundering if i changed that to s19 or S20 whether that would make it start up last, or am i going about it compleatly wrong?

thanks for any input on this

berrance
 
Old 10-13-2005, 02:37 PM   #2
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
Yes, the number is the order in which things are started (scripts with the same number will be started in undefined order - probably alphabetical if standard shell pattern matching is used). The S is for start scripts and the K is for stop (kill) scripts.

You're on the right track, it sounds like whatever software you're trying to run is dependant on something else that hasn't started yet. Try changing the link to a higher number. If it's some userland thing that other scripts are not dependant on, then S99 will be fine. It'll be started after everything else.
 
Old 10-13-2005, 03:06 PM   #3
berrance
Member
 
Registered: Aug 2004
Location: Hull - England
Distribution: Ubunto and slowly switching to debian
Posts: 308

Original Poster
Rep: Reputation: 30
as soon as i posted this i tried it any way and it worked, well it started last but it didnt work. the piece of software i am trying to start is squid but that will only work properly if the internet connection is started first but that takes about 2 or more minuets to connect for some reason so it still doesnt work, im just trying to modify my /etc/init.d/cnxadslctl now so that it sleeps for about 120 seconds befor it loads the next piece of software but having no look so im going to create a seprate script that contains just "sleep 120" to run after my adsl connection but befor the next piece of software
 
Old 10-13-2005, 03:15 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Rather than mucking about with squid and timings I'd investigate
why it takes > 2 minutes for your connection to happen.

What kind of connection are you using?


Cheers,
Tink
 
Old 10-13-2005, 03:49 PM   #5
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
Sleeping for 2 minutes is not a good solution. As tinkster said, you need to figure out why it takes so long to connect.

As a temporary "solution", you can use a loop to test the connection rather than just sleeping:

while true; do
ping -c1 www.linux.org > /dev/null 2>&1
if [[ $? == 0 ]]; then
break
fi
sleep 5
done

This will try pinging www.linux.org every five seconds until it succeeds (a packet is received).

But, really, it shouldn't take 2 minutes to connect. Something is wrong there.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 03:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 10:40 PM
resort order of startup services robert_edwards Fedora 0 07-29-2004 07:30 AM
How make a script in order to set global alias? RickHunter_Ve Linux - Newbie 7 06-08-2004 03:13 PM
Shell-script: search item in any order macone Programming 3 08-13-2002 11:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:15 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration