[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: ntpdate-like functionality in ntpd
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2015-02-19 11:53:08
Message-ID: CAK1hOcPHzwnWOKF7x=OH7sgpz+vSheyBr=wtE-Jv6YXcYC6Znw () mail ! gmail ! com
[Download RAW message or body]

On Wed, Feb 18, 2015 at 12:30 PM, Sven-Göran Bergh
<sgb-list+busybox@systemaxion.se> wrote:
>> 1. Run "something" such as ntpdate which sets an approximate time
>> quickly, but that also terminates quickly if there is no network
>> connectivity or NTP server does not respond
>> 2. As soon as this is done, launch ntpd and leave it running in the
>> background. If I am not wrong, Busybox's ntpd can be left running in
>> the background mostly unattended and will just do its stuff when the
>> network and NTP server is available.
>> 3. Then proceed with the rest of the initialisation.
>>
>> So far the missing part of the puzzle is 1 :-)
>
>
> As I understand it you are looking for q&d solution. In that case wouldn't
> just something like this do the trick?
>
> busybox timeout -t 2 busybox ntpd -nqp ....
>
> Without a server reply ntpdate will not save you anyway.

In fact this solution is not "dirty".

It does exactly what was asked for: it tries to set the time,
but aborts if this can't be done in alotted time.

And in the old Unix tradition, both parts of the task (syncing time
and aborting on timeout) are done with two separate tools.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic