On Tuesday 15 March 2011 14:48, Sergey Naumov wrote:
> Hello.
> 
> I am trying to get rid of ntpd package with it's ntpdate and switch to
> busybox's ntpd implementation.
> -q option says that ntpd will exit as soon as time will be set and
> that this behavior resembles that of ntpdate.
> Unfortunately, it is true only if there is a host with given address
> and if there is running ntp server on the host. In other cases ntpd
> will retry to connect to unexisting host forever or maybe long enough
> even if it is running in foreground and -q is provided.

In my testinf, it exits after one minute of trying:

# date; ./busybox ntpd -dddwq -p 10.0.0.9; echo Exitcode:$?; date
Mon Apr  4 00:53:54 CEST 2011
ntpd: sent query to 10.0.0.9
ntpd: poll 16s, sockets:1, poll interval:1s
ntpd: timed out waiting for 10.0.0.9, reach 0x00, next query in 1s
ntpd: poll 2s, sockets:0, poll interval:1s
ntpd: sent query to 10.0.0.9
ntpd: poll 16s, sockets:1, poll interval:1s
ntpd: timed out waiting for 10.0.0.9, reach 0x00, next query in 1s
ntpd: poll 2s, sockets:0, poll interval:1s
ntpd: sent query to 10.0.0.9
ntpd: poll 16s, sockets:1, poll interval:1s
ntpd: timed out waiting for 10.0.0.9, reach 0x00, next query in 2s
ntpd: poll 3s, sockets:0, poll interval:1s
ntpd: sent query to 10.0.0.9
ntpd: poll 16s, sockets:1, poll interval:1s
/bin/bash: line 1:  2744 Alarm clock             ./busybox ntpd -dddwq -p 
10.0.0.9
Exitcode:142
Mon Apr  4 00:54:54 CEST 2011


> Is there a way to emulate ntpdate behavior (fast time set or fast exit
> on failure) with busybox's ntpd?

How fast ntpdate fails when given non-existent server?

Maybe be need to make timeout configurable? Say, -Q SECS?

-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to