How to run script (sleep360) without delaying bootup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux