[ntp:questions] ntpd behavior to replace ntpdate single shot

Matthew Weber matthew.weber at rockwellcollins.com
Fri Nov 2 03:45:42 UTC 2018


All,

On Wed, Oct 24, 2018 at 8:49 AM Matthew Weber
<matthew.weber at rockwellcollins.com> wrote:
>
> I'm working on an update to an init script for Buildroot and was
> wondering if I can accomplish the following sequence with a single
> call to ntpd.
>

I ended up going the route of using sntp in-place of ntpdate and kept
ntpd as it originally was.

https://patchwork.ozlabs.org/patch/992167/

> Original sequence
> -------------------------------------
> ntpdate <server>   #blocks
> ntpd -g
> #time is valid
>
> Updated scenario #1 - Time is never initially set and I always
> timeout. I believe it's a step issue and I tried including the -x and
> -G.
> -------------------------------------
> ntpd -g -x -G -w 15   # blocks from 15sec, times out and continues
> # time is not valid but server lists in ntpq -p
>
> Updated scenario #2 - Works by forcing the step information to drop
> and time gets initially set and then maintained.
> -------------------------------------
> ntpd -gq &
> # manage the pid from the one-shot with a while loop until the timeout
> and kill ntpd as it would hang forever if the server can't be reached
> (is there away around this?)
> ntpd -g
> # time is valid



-- 
Matthew L Weber / Pr Software Engineer
Airborne Information Systems / RC Linux Secure Platforms
MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA
www.rockwellcollins.com

Note: Any Export License Required Information and License Restricted
Third Party Intellectual Property (TPIP) content must be encrypted and
sent to matthew.weber at corp.rockwellcollins.com.


More information about the questions mailing list