[LEDE-DEV] [RFC] sysntpd: restore support for peer-less (standalone) mode
Philip Prindeville
philipp_subx at redfish-solutions.com
Wed Mar 8 15:40:25 PST 2017
> On Mar 6, 2017, at 3:20 PM, Piotr Dymacz <pepe2k at gmail.com> wrote:
>
> ntpd from Busybox supports peer-less (standalone) mode when it's started
> with option -l and without any peer provided with option -p. In this
> mode ntpd uses local time as reference and acts as stratum 1 server.
>
> This mode can be used in isolated networks, where Internet access and/or
> other NTP server/s are not available, but the device has some other way
> of getting correct time, like e.g. GPS (ugps supports setting local time
> by default).
It’s not enough to have your clock set to the correct time initially: you also need to assure the accuracy of your clock as time goes by, i.e. ensuring that it’s not running too fast or head or too slow behind.
All clocks will have some inherent inaccuracy (due to thermal noise, age, inconsistent power, etc). But comparing them regularly to other clocks (i.e. peers or servers) allows you to understand how your own clock is behaving and to adjust it (i.e. “discipline it”) accordingly.
I don’t think that lying about the accuracy of your clock by declaring it stratum 1 is a good thing.
At least “fudge” the local clock and downgrade its stratum (however busybox does that).
>
> Support for this mode was incorrectly disabled/removed in:
> 1527f96ca6e196fa17c96fdb3ae520158fa5943f
>
> Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
> ---
> package/utils/busybox/files/sysntpd | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/utils/busybox/files/sysntpd b/package/utils/busybox/files/sysntpd
> index 98260be..e693e40 100755
> --- a/package/utils/busybox/files/sysntpd
> +++ b/package/utils/busybox/files/sysntpd
> @@ -45,7 +45,7 @@ start_service() {
>
> [ $use_dhcp = 1 ] && get_dhcp_ntp_servers "$dhcp_interface"
>
> - [ -z "$server" ] && return
> + [ -z "$server" -a "$enable_server" = "0" ] && return
>
> procd_open_instance
> procd_set_param command "$PROG" -n -N
> --
> 2.7.4
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
More information about the Lede-dev
mailing list