LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   startup script order (https://www.linuxquestions.org/questions/linux-software-2/startup-script-order-372691/)

berrance 10-13-2005 01:06 PM

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

ioerror 10-13-2005 01:37 PM

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.

berrance 10-13-2005 02:06 PM

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

Tinkster 10-13-2005 02:15 PM

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

ioerror 10-13-2005 02:49 PM

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.


All times are GMT -5. The time now is 06:46 PM.