Harald,

> -----Original Message-----
> From: Harald Becker [mailto:ra...@gmx.de]
> Sent: Tuesday, March 18, 2014 2:31 PM
> To: Bryan Evenson
> Cc: busybox@busybox.net; Rich Felker; Laszlo Papp; Adam Tkáč
> Subject: Re: Ntpd config file support
> 
> Hi Bryan !
> 
> On 18-03-2014 18:02 Bryan Evenson <beven...@melinkcorp.com> wrote:
> 
> >Harald had suggested an example startup script (I'm assuming under the
> >examples/ directory of the Busybox source?).  With a working example
> >and an easy place to find the ntpd command line options, I'd probably
> >give the Busybox-provided ntpd a try.
> 
> Have you ever tried "busybox ntpd --help"? If Busybox has bean compiled
> with full usage messages (the default) this shall give you all necessary info
> about ntpd command line options:

With my setup, busybox was not being compiled with the full usage messages, so 
this just returns "ntpd: applet not found" on my system.  My initial Busybox 
build did not have ntpd included in its configuration.  This meant I would have 
had to re-build Busybox with ntpd included just to figure out how to use it 
(and to see if the options I wanted to use were available), or to start looking 
through the source code.  In retrospect, the source code isn't that bad to look 
through and would have been my best bet.

> 
> from my 1.19.0 version this gives: (may have changes on newer
> versions)
> 
> Usage: ntpd [-dnqNw] [-S PROG] [-p PEER]...
> 
> NTP client/server
> 
> Options:
>       -d      Verbose
>       -n      Do not daemonize
>       -q      Quit after clock is set
>       -N      Run at high priority
>       -w      Do not set time (only query peers), implies -n
>       -S PROG Run PROG after stepping time, stratum
>                 change, and every 11 mins
>         -p PEER       Obtain time from PEER (may be repeated)
> 
> 
> So normal Daemon startup is just:
> 
> ntpd -p PEERADDRESS
> 
> 
> A (very) simple script solution:
> 
> ntpd -p `cat /etc/timeserver`
> 
> This however does not check for parameter mistakes, but with some awk or
> sed scripting you can parse and check your config file and even allow for
> multiple time server specification (adding extra -p options).
> 
> 
> All that without increasing Busybox binary size, which would give us no extra
> functionality (when just reading config file on ntpd startup).
> 
> --
> Harald

Regards,
Bryan
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to