ntp init script

Bruce Dubbs bruce.dubbs at gmail.com
Mon Aug 23 15:10:27 PDT 2010


Jeremy Huntwork wrote:
> On 8/23/10 4:54 PM, Bruce Dubbs wrote:
>> Since we use *pool.ntp.org, how would you propose doing that?
>> I agree that it would be nice, but I don't know how.
> 
> I don't know either, at least, I haven't given much thought to it. My 
> solution for myself was just to assume a correct date has been set at 
> install and kill the -q in the init script entirely.
> 
> This works:
> 
> if ping -c1 0.pool.ntp.org >/dev/null 2>&1 ; then echo yay ; fi

Thee are a couple of problems here.  First the version of ping we have 
does not have a settable timeout (other versions do have that).  If 
there is no network, the boot will hang for a while waiting for ping 
response or timeout.

Second, a ping to pool is insufficient.  The pool server returns one or 
more IP addresses to get the actual ntp server.  For instance right now 
I have:

==============================================================================
+ntp1.Rescomp.Be 169.229.128.214  3 u   15  128  377   62.358  -33.688 
  1.074
  153.16.4.136    .STEP.          16 u    - 1024    0    0.000    0.000 
4000.00
*ntp.your.org    .CDMA.           1 u   74  128  377   42.306  -32.980 
  3.954
+draco.netservic 64.113.32.5      2 u   70  128  377   54.936  -27.061 
  4.112

What if the ntp server provided is down like in the 2nd entry above?

This problem is not easily solved.

   -- Bruce



More information about the blfs-dev mailing list