How to run script (sleep360) without delaying bootup

Vikram Goyal vikigoyal at gmail.com
Sun Apr 22 16:47:33 UTC 2007


On Sun, Apr 22, 2007 at 05:11:29PM +0200, Nigel Henry wrote:
> Ntpd on my FC2 install has a problem when no dialup connection is available at 
> bootup, but does handle this well on FC6.
> 
> I have a script in the ntp tarball named ntp-restart which appears to do what 
> I want, but if I make an entry in /etc/rc.d/rc.local to run it, and as it has 
> a "sleep 360" in the script, it justs hangs the bootup for 6 mins until the 
> script has run to completion. Script below.
> 
> #!/bin/sh
> #
> # This script can be used to kill and restart the NTP daemon. Edit the
> # /usr/local/bin/ntpd line to fit.
> #
> kill -INT `ps -ax | egrep "ntpd" | egrep -v "egrep" | sed 
> 's/^\([ 0-9]*\) .*/\1'/`
> sleep 360           #changed from 10
> /usr/local/bin/ntpd -g
> /usr/local/bin/ntp-wait
> exit 0
> 
> What I need is a way to run this script, either at, or after bootup, but 
> automatically. This would give me enough time after bootup, and logging in, 
> to make the Internet connection. Bear in mind that it needs to run as root, 
> otherwise I could put something in KDE's autostart directory to run it.
> 
> Ideally of course would be a script to ping an IP address out there in the big 
> wide world, and when it gets a positive response, would run the ntp-restart 
> script, which then could be reset to "sleep 10", as a 6 min delay would not 
> be necessary.
> 
> Any ideas folks? All suggestions, as usual, very gratefully received.
> 
> Nigel.
> 
I have just posted a script in another thread 'for faster boot' try it

Thanks!
-- 
vikram...
         ||||||||
         ||||||||
^^'''''^^||root||^^^'''''''^^
        // \\   ))
       //(( \\// \\
      // /\\ ||   \\
     || / )) ((    \\
-- 
Never try to teach a pig to sing.  It wastes your time and annoys the pig.
		-- Lazarus Long, "Time Enough for Love"
-- 
 o
~|~
 =
Registered Linux User #285795




More information about the users mailing list