Re: [chrony-users] Will it EVER synch and start serving?

2021-03-01 Thread Lonnie Abelbeck


> On Mar 1, 2021, at 11:16 AM, Aaron D. Gifford  
> wrote:
> CONFIG:
> ratelimit interval 3 burst 8
> dumpdir /var/db/chrony
> ntsdumpdir /var/db/chrony
> cmdport 0
> bindaddress local-public-ipv4-address.example.com
> bindacqaddress local-public-ipv4-address.example.com
> bindaddress local-public-ipv6-address.example.com
> bindacqaddress local-public-ipv6-address.example.com
> server timesource-8-example.org iburst
> server timesource-8-example.org iburst
> server timesource-8-example.org iburst
> server timesource-8-example.org iburst
> server timesource-8-example.org iburst
> server timesource-8-example.org iburst
> server timesource-8-example.org iburst
> server timesource-8-example.org iburst
> server ip6timesource.example.org iburst
> 
> 
> This is a FreeBSD 12.2-RELEASE-p4 host running the chrony-4.0 FreeBSD package.

Just guessing, but is it possible you have too many server entries, all with 
iburst ?

Lonnie


--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Can't synchronise: no majority

2020-03-25 Thread Lonnie Abelbeck



> On Mar 25, 2020, at 8:22 AM, Niko Delarich  wrote:
> 
> Hi,
> 
> we use chrony 3.5 in an embedded network device (Linux 4.4.122 armv7l).
> In some of our customers installations we've noticed that chrony is sometimes 
> unable to synchronize correctly if the two configured NTP servers don't agree 
> on a time (i.e. the source intervals don't overlap).
> 
> ...

> After comparing the source intervals, the "Can't synchronise: no majority" 
> message is emitted if the two servers don't agree on a time.
> ...

> Or is there maybe a configuration option I'm missing? Setting one of the 
> sources to "trusted" manually is most likely not an option for us since the 
> servers may be assigned by a DHCP server.

I have seen this happen over the years using chrony as well ... adding a third 
source (or more) is the solution I used.

Lonnie


--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Syncing time as with a single request

2020-03-01 Thread Lonnie Abelbeck
Hi Bill,

I appreciate your comments, but chronyd is called immediately after the 
foreground "chronyd -q ..." so that should mitigate your concerns.

Lonnie


> On Mar 1, 2020, at 4:27 PM, Bill Unruh  wrote:
> 
> There is a battle between acuracy and speed. Your time might be synched, but
> your rate may be way off. Thus your clock might lose 10 sec per minute with
> your procedure. To get a good estimate for the rate you need to spend more
> time. (with 4 sec you might reduce the rate to something like 20-200PPM from
> true 1 sec per second ( I am assuming that the accuracy of your reading the
> remote clock is something like 5 to 50 microseconds error.) Now you may not
> care, which is fine, But you might, as soon as the system comes up, want to
> find out the some elapsed time to high accuracy. Then this system is not
> great. Of course if all you care is is that the the system is synced to one
> second and the rate is correct to 1% is good enough. Then that is fine. But
> you might want to go into your decisions with eyes open.
> 
> 
> 
> On Sun, 1 Mar 2020, Lonnie Abelbeck wrote:
> 
>> 
>> 
>>> On Jan 28, 2020, at 2:35 AM, Miroslav Lichvar  wrote:
>>> 
>>> On Tue, Jan 28, 2020 at 04:11:49AM +, Gustav Krantz wrote:
>>>> Would it be possible to do the initial sync with a single request per 
>>>> server? If so how would this be done and what would the drawback be?
>>> 
>>> The current development code in git supports a single-sample
>>> selection/update mode, enabled by setting maxsample to 1, but it's
>>> meant to be used only in the "ntpdate" mode (-q/-Q option) as it
>>> doesn't adjust the frequency of the clock. You could use it for the
>>> initial correction before normally starting chronyd.
>>> 
>>> # chronyd -q 'pool pool.example.com maxsamples 1 iburst'
>>> 
>> 
>> I have been testing this new "maxsamples 1" feature with the latest 
>> chrony-master.tar.gz snapshot of 2020-02-19.
>> 
>> Works very nicely.  Our project first does a quick foreground "chronyd -q 
>> ..." step (historical from sntp/ntpdate days) and then followed by a 
>> background chronyd .
>> 
>> With "maxsamples 1", our boot times are 4-6 seconds faster.
>> 
>> Using time.cloudflare.com, the step is performed in about 230 ms.  (versus 
>> 4.4 seconds before)
>> --
>> pbx4 ~ # time chronyd -q -t 8 "server time.cloudflare.com maxsamples 1 
>> iburst"
>> 2020-03-01T21:31:53Z chronyd version DEVELOPMENT starting (+CMDMON +NTP 
>> +REFCLOCK +RTC +PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH -IPV6 -DEBUG)
>> 2020-03-01T21:31:53Z Initial frequency -17.927 ppm
>> 2020-03-01T21:31:53Z System clock wrong by -0.000330 seconds (step)
>> 2020-03-01T21:31:53Z chronyd exiting
>> 
>> real 0m0.229s
>> user 0m0.006s
>> sys  0m0.005s
>> --
>> 
>> While testing, a '-t 8' is needed since DNS errors/misconfigurations can 
>> cause "chronyd -q ..." to hang, seemingly forever.
>> 
>> Example, using a typo .con instead of .com ... Control-C'ed to quit:
>> --
>> pbx4 ~ # time chronyd -q "server time.cloudflare.con maxsamples 1 iburst"
>> 2020-03-01T21:34:23Z chronyd version DEVELOPMENT starting (+CMDMON +NTP 
>> +REFCLOCK +RTC +PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH -IPV6 -DEBUG)
>> 2020-03-01T21:34:23Z Initial frequency -17.927 ppm
>> ^C2020-03-01T21:41:07Z chronyd exiting
>> 
>> real 6m43.632s
>> user 0m0.003s
>> sys  0m0.010s
>> --
>> 
>> Adding the '-t 8' guards against those special DNS issues, without it a box 
>> could hang at startup.  Example, same typo with a '-t 8':
>> --
>> pbx4 ~ # time chronyd -q -t 8 "server time.cloudflare.con maxsamples 1 
>> iburst"
>> 2020-03-01T21:41:38Z chronyd version DEVELOPMENT starting (+CMDMON +NTP 
>> +REFCLOCK +RTC +PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH -IPV6 -DEBUG)
>> 2020-03-01T21:41:38Z Initial frequency -17.927 ppm
>> 2020-03-01T21:41:46Z chronyd exiting
>> 
>> real 0m8.014s
>> user 0m0.002s
>> sys  0m0.009s
>> --
>> 
>> Lonnie
>> 
>> 
>> 
>> --
>> To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
>> with "unsubscribe" in the subject.
>> For help email chrony-users-requ...@chrony.tuxfamily.org
>> with "help" in the subject.
>> Trouble?  Email listmas...@chrony.tuxfamily.org.
>> 
> 
> -- 
> To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org with 
> "unsubscribe" in the subject.
> For help email chrony-users-requ...@chrony.tuxfamily.org with "help" in the 
> subject.
> Trouble?  Email listmas...@chrony.tuxfamily.org.
> 
> 
> 


--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Syncing time as with a single request

2020-03-01 Thread Lonnie Abelbeck



> On Jan 28, 2020, at 2:35 AM, Miroslav Lichvar  wrote:
> 
> On Tue, Jan 28, 2020 at 04:11:49AM +, Gustav Krantz wrote:
>> Would it be possible to do the initial sync with a single request per 
>> server? If so how would this be done and what would the drawback be?
> 
> The current development code in git supports a single-sample
> selection/update mode, enabled by setting maxsample to 1, but it's
> meant to be used only in the "ntpdate" mode (-q/-Q option) as it
> doesn't adjust the frequency of the clock. You could use it for the
> initial correction before normally starting chronyd.
> 
> # chronyd -q 'pool pool.example.com maxsamples 1 iburst'
> 

I have been testing this new "maxsamples 1" feature with the latest 
chrony-master.tar.gz snapshot of 2020-02-19.

Works very nicely.  Our project first does a quick foreground "chronyd -q ..." 
step (historical from sntp/ntpdate days) and then followed by a background 
chronyd .

With "maxsamples 1", our boot times are 4-6 seconds faster.

Using time.cloudflare.com, the step is performed in about 230 ms.  (versus 4.4 
seconds before)
--
pbx4 ~ # time chronyd -q -t 8 "server time.cloudflare.com maxsamples 1 iburst"
2020-03-01T21:31:53Z chronyd version DEVELOPMENT starting (+CMDMON +NTP 
+REFCLOCK +RTC +PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH -IPV6 -DEBUG)
2020-03-01T21:31:53Z Initial frequency -17.927 ppm
2020-03-01T21:31:53Z System clock wrong by -0.000330 seconds (step)
2020-03-01T21:31:53Z chronyd exiting

real0m0.229s
user0m0.006s
sys 0m0.005s
--

While testing, a '-t 8' is needed since DNS errors/misconfigurations can cause 
"chronyd -q ..." to hang, seemingly forever.

Example, using a typo .con instead of .com ... Control-C'ed to quit:
--
pbx4 ~ # time chronyd -q "server time.cloudflare.con maxsamples 1 iburst"
2020-03-01T21:34:23Z chronyd version DEVELOPMENT starting (+CMDMON +NTP 
+REFCLOCK +RTC +PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH -IPV6 -DEBUG)
2020-03-01T21:34:23Z Initial frequency -17.927 ppm
^C2020-03-01T21:41:07Z chronyd exiting

real6m43.632s
user0m0.003s
sys 0m0.010s
--

Adding the '-t 8' guards against those special DNS issues, without it a box 
could hang at startup.  Example, same typo with a '-t 8':
--
pbx4 ~ # time chronyd -q -t 8 "server time.cloudflare.con maxsamples 1 iburst"
2020-03-01T21:41:38Z chronyd version DEVELOPMENT starting (+CMDMON +NTP 
+REFCLOCK +RTC +PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH -IPV6 -DEBUG)
2020-03-01T21:41:38Z Initial frequency -17.927 ppm
2020-03-01T21:41:46Z chronyd exiting

real0m8.014s
user0m0.002s
sys 0m0.009s
--

Lonnie



--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [EXTERNAL] Re: [chrony-users] Syncing time as with a single request

2020-02-04 Thread Lonnie Abelbeck



> On Feb 4, 2020, at 4:12 PM, Gustav Krantz  wrote:
> 
> From: Miroslav Lichvar  
> Sent: Tuesday, January 28, 2020 12:36 AM
> 
>> The current development code in git supports a single-sample 
>> selection/update mode, enabled by setting maxsample to 1, but it's meant to 
>> be used only in the "ntpdate" mode (-q/-Q option) as it doesn't adjust the 
>> frequency of the clock. You could use it for the initial correction before 
>> normally starting chronyd.
>> 
>> # chronyd -q 'pool pool.example.com maxsamples 1 iburst'
> 
> Hello Miroslav,
> Thank you for your answer. This is exactly what I am looking for, however it 
> seems that what you are suggesting is not working.
> 
> x:~$ sudo chronyd -q 'pool 0.pool.ntp.org maxsamples 1 iburst'
> 2020-02-04T22:03:05Z chronyd version 3.3 starting (+CMDMON +NTP +REFCLOCK 
> +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)
> 2020-02-04T22:03:05Z Initial frequency 6.501 ppm
> 2020-02-04T22:05:22Z No suitable source for synchronisation
> 2020-02-04T22:05:22Z chronyd exiting
> 
> Removing the maxsamples 1, will allow a sync, but with assumingly several 
> requests sent with a wait in between.
> x:~$ sudo chronyd -q 'pool 0.pool.ntp.org iburst'
> 2020-02-04T21:58:58Z chronyd version 3.3 starting (+CMDMON +NTP +REFCLOCK 
> +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)
> 2020-02-04T21:58:58Z Initial frequency 6.501 ppm
> 2020-02-04T21:59:03Z System clock wrong by 0.001764 seconds (step)
> 2020-02-04T21:59:03Z chronyd exiting
> 
> Do you have any ideas of what could be the issue?
> 
> Thanks,
> Gustav Krantz

You need to build the "the current development code in git" for this new 
'maxsamples 1' feature. No official release with this new feature is available 
yet.

Lonnie



--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Syncing time as with a single request

2020-01-28 Thread Lonnie Abelbeck



> On Jan 28, 2020, at 2:35 AM, Miroslav Lichvar  wrote:
> 
> The current development code in git supports a single-sample
> selection/update mode, enabled by setting maxsample to 1, but it's
> meant to be used only in the "ntpdate" mode (-q/-Q option) as it
> doesn't adjust the frequency of the clock. You could use it for the
> initial correction before normally starting chronyd.
> 
> # chronyd -q 'pool pool.example.com maxsamples 1 iburst'
> 
> -- 

Looking forward to a -pre1 official pre-release.

Lonnie


-- 
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org 
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org 
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Time synchronisation over a high-latency packet radio network

2019-05-07 Thread Lonnie Abelbeck



> On May 7, 2019, at 5:19 PM, Stuart Longland  
> wrote:
> 
> On 8/5/19 1:30 am, Lonnie Abelbeck wrote:
>> Just curious, it appears you have native DNS, why do you need to proxy NTP 
>> over APRS (unless you use a similar technique for DNS).
> 
> Ahh, because I actually do not have DNS at all.  Not when the devices
> are out in the field. :-)
> 
> The only time I have DNS is when I plug a USB cable into the
> PocketBeagle that connects to a computer with an Internet connection.

Thanks for the added info ... I was not sure if your AX.25 TNC supported some 
SLIP-like protocol (KISS ?).

BTW, I'm old enough to have used SLIP at 9600 baud, when it was bleeding edge 
:-)

Lonnie


--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Time synchronisation over a high-latency packet radio network

2019-05-07 Thread Lonnie Abelbeck



> On May 6, 2019, at 10:53 PM, Stuart Longland  
> wrote:
> 
> Hi all,
> 
> I've got a problem where I need to provide a time synchronisation
> service for small embedded computers whose only link to the outside
> world is a slow and high-latency packet radio network.

Stuart, Indeed very interesting...

> Below is my chronyd.conf:
> - BEGIN chronyd.conf -
> # Welcome to the chrony configuration file. See chrony.conf(5) for more
> # information about usuable directives.
> pool 2.debian.pool.ntp.org iburst
> 
> # NTP proxy over APRS
> server 127.0.0.1 port 3123 trust maxdelay 10 minpoll 3

Just curious, it appears you have native DNS, why do you need to proxy NTP over 
APRS (unless you use a similar technique for DNS).

BTW, at startup our project always steps the time using (8 second timeout would 
be too low for you):
--
chronyd -q -t 8 "server time.example.tld iburst"
--
before starting "chronyd" in the background. (no systemd).

Lonnie


--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] libedit 20180525-3.1 escapes spaces in tab-completion

2018-06-13 Thread Lonnie Abelbeck


> On Jun 12, 2018, at 1:19 AM, Miroslav Lichvar  wrote:
> 
> On Mon, Jun 11, 2018 at 07:44:05AM -0500, Lonnie Abelbeck wrote:
>>> Maybe there is an option to disable the new behavior?
>> 
>> I looked, and don't see an editline global option for this new feature.
> 
> I think it's strange that it does that with editline, but not
> readline. Isn't editline supposed to be compatible with readline?
> 
> Maybe the multiword commands (e.g. the -v options) should be handled
> in some other way? Or is that too much work?

A complete fix is submitted to chrony-dev.

Lonnie


-- 
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org 
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org 
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] libedit 20180525-3.1 escapes spaces in tab-completion

2018-06-12 Thread Lonnie Abelbeck


> On Jun 12, 2018, at 1:19 AM, Miroslav Lichvar  wrote:
> 
> On Mon, Jun 11, 2018 at 07:44:05AM -0500, Lonnie Abelbeck wrote:
>>> Maybe there is an option to disable the new behavior?
>> 
>> I looked, and don't see an editline global option for this new feature.
> 
> I think it's strange that it does that with editline, but not
> readline. Isn't editline supposed to be compatible with readline?

My understanding is editline is (was) a "compatible" subset of readline.  
Looking at the readline docs ...

http://www.delorie.com/gnu/docs/readline/rlman_47.html

There are optional rl_filename_quoting_function and 
rl_filename_quote_characters which defaults to the null string, no quoting.  
This latest libedit 20180525-3.1 seems to not be compatible with these quoting 
options.


> Maybe the multiword commands (e.g. the -v options) should be handled
> in some other way? Or is that too much work?

I'm not certain how that would be done, first we would add  to the break 
characters:
--
- rl_basic_word_break_characters = "\t\n\r";
+ rl_basic_word_break_characters = " \t\n\r";
--
then possibly the command_name_generator() would use a 2 dimensional array to 
match ... not sure ...

Alternatively, I used this patch below to ignore any backslash quoting, almost 
perfect except the stdout still contains a '\ ', while internally the backslash 
is ignored.

Lonnie

--- chrony-3.3/client.c.orig2018-06-12 13:29:58.335070738 -0500
+++ chrony-3.3/client.c 2018-06-12 13:48:26.650116681 -0500
@@ -109,6 +109,7 @@
   if (on_terminal) {
 #ifdef FEAT_READLINE
 char *cmd;
+char *p, *q;
 
 rl_attempted_completion_function = command_name_completion;
 rl_basic_word_break_characters = "\t\n\r";
@@ -119,6 +120,13 @@
 
 /* user pressed return */
 if( *cmd != '\0' ) {
+  /* strip any backslash quoting */
+  for (p = q = cmd; *p; p++) {
+if (*p != '\\') {
+  *q++ = *p;
+}
+  }
+  *q = '\0';
   strncpy(line, cmd, sizeof(line) - 1);
   line[sizeof(line) - 1] = '\0';
   add_history(cmd);



--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] libedit 20180525-3.1 escapes spaces in tab-completion

2018-06-11 Thread Lonnie Abelbeck


> On Jun 11, 2018, at 2:04 AM, Miroslav Lichvar  wrote:
> 
> On Fri, Jun 08, 2018 at 06:16:57PM -0500, Lonnie Abelbeck wrote:
>> Hi,
>> 
>> Our project did a version bump of libedit to 20180525-3.1 and noticed spaces 
>> are now being escaped with a backslash with chronyc's tab-completion.
> 
> Interesting.
> 
>> The change occurred with libedit revision 1.47 2017/10/15
>> http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/filecomplete.c.diff?r1=1.46=1.47
>> 
>> I took a stab at a fix by patching CPS_NormalizeLine() ...
> 
> I think the fix should be closer to the readline/editline-specific
> code.

I agree, if possible.

> Maybe there is an option to disable the new behavior?

I looked, and don't see an editline global option for this new feature.

In chronyc, the minimal code added for tab-completion is leveraged by using the 
filecomplete.c routines.

The question is, for chronyc should '\ ' input be handled as a ' ' or present 
an error.  Possibly a '\ ' could occur in other external ways ?

Lonnie


--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



[chrony-users] libedit 20180525-3.1 escapes spaces in chronyc tab-completion

2018-06-08 Thread Lonnie Abelbeck
Hi,

Our project did a version bump of libedit to 20180525-3.1 and noticed spaces 
are now being escaped with a backslash with chronyc's tab-completion.

Example:
--
chronyc> sources
sources sources -v  sourcestats sourcestats -v 

chronyc> sources
chronyc> sources\ -v 
Unrecognized command
--

The change occurred with libedit revision 1.47 2017/10/15
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/filecomplete.c.diff?r1=1.46=1.47

I took a stab at a fix by patching CPS_NormalizeLine() ...

--- chrony-3.3/cmdparse.c.orig  2018-06-08 17:07:48.644094438 -0500
+++ chrony-3.3/cmdparse.c   2018-06-08 17:28:30.578778580 -0500
@@ -218,7 +218,8 @@
 if (first && strchr("!;#%", *p))
   break;
 
-*q++ = *p;
+if (!(*p == '\\' && isspace((unsigned char)*(p+1
+  *q++ = *p;
 space = first = 0;
   }
 
and it solves the issue with limited testing.

(BTW, applying De Morgan's law to the added logic might make it less readable, 
so I left it as shown.)

Lonnie


--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] can not sync with vmware ntp server

2017-06-06 Thread Lonnie Abelbeck

On Jun 6, 2017, at 5:04 AM, Thomas Aichinger  wrote:

> Hi,
> 
> I run an esx hypervisor with ntp v4 activated.
> I want to use this esx as time server for all my virtual linux ubuntu clients 
> on the esx.
> 
> When I use ntp it gets syncronized
> 
> === chrony.conf ===
> server 37.75.141.1 minpoll 2 maxpoll 4 polltarget 16

Is your NTP server listening on IPv4 ?  Your traces show IPv6.

Lonnie


--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] [patch] adds tab-completion to chronyc

2016-12-08 Thread Lonnie Abelbeck

On Dec 8, 2016, at 12:36 AM, Miroslav Lichvar <mlich...@redhat.com> wrote:

> On Wed, Dec 07, 2016 at 03:33:37PM -0600, Lonnie Abelbeck wrote:
>> Hi Miroslav,
>> 
>> Attached is a patch I created (against chrony 2.4.1) to add tab-completion 
>> to chronyc.  A relatively simple addition.
>> 
>> Also here: 
>> https://sourceforge.net/p/astlinux/code/8023/tree//branches/1.0/package/chrony/chrony-0100-chronyc-tab-completion.patch
>> 
>> Works quite well in my testing, using either libedit 20160903-3.1 or 
>> readline 7.0 .  All cross-compiled from source.
> 
> Thanks, Lonnie. This is useful. Would it be possible to parse the list
> of commands from the usage text instead of maintaining a separate
> list? The chronyc support in bash-completition works like that.

I presume you meant the "help" output ... Yes, I briefly looked at that, 
probably more code would be required than the data size of command_names[], and 
the command_names[] entries can be tweaked specifically for tab-completion.

My thought is to keep things simple (as this patch does) and have a separate 
tab-completion list.

Possibly, down the road. give_help() text, process_line() parsing matches, and 
tab-completion text could all be in one structure, but probably not worth 
stirring-the-code over.


> However, there are some recommendations for submitting patches. They
> should go to the chrony-dev list and they should be git patches
> against HEAD. I'd at least need an email address to which I can set
> the author field in git.

Attached is a git patch against HEAD.

Next time I will use the chrony-dev list. :-)


Lonnie




0001-add-tab-completion-to-chronyc-with-libedit-readline.patch
Description: Binary data




Re: [chrony-users] Request: Add an optional timeout option for 'chronyd -q ...'

2016-12-02 Thread Lonnie Abelbeck

On Dec 2, 2016, at 7:57 AM, Miroslav Lichvar <mlich...@redhat.com> wrote:

> On Thu, Dec 01, 2016 at 07:07:53AM -0600, Lonnie Abelbeck wrote:
>>> How about returning 0 if the clock was in a synchronised state (the
>>> reference was updated at least once) and 1 if not? With -q that would
>>> be 0 only if the clock was stepped.
>> 
>> Yes, that would work for our situation.
>> 
>> For example using "chronyd -q -u ntp -t 10", if after 5 seconds the clock 
>> was in a synchronized state, it steps the clock and exits 0.  Alternatively 
>> if after 10 seconds the clock was not yet in a synchronized state, it would 
>> exit with a non-zero (timeout) return.
> 
> The -t option is now in git. If you test it, please let me know if it
> works for you as expected.

Works perfectly !

You will want to add the -t option to the Usage:
--
} else if (!strcmp("-h", *argv) || !strcmp("--help", *argv)) {
- printf("Usage: %s [-4|-6] [-n|-d] [-q|-Q] [-r] [-R] [-s] [-f 
FILE|COMMAND...]\n",
+ printf("Usage: %s [-4|-6] [-n|-d] [-q|-Q] [-r] [-R] [-s] [-t secs] [-f 
FILE|COMMAND...]\n",
--

I'm thinking " -t 8 " will be our production value.  Typically it takes 4.5 to 
5.5 seconds for most any pool server.
--
chronyd -q -t 8 'server pool.ntp.org iburst'
--

Lonnie


--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Request: Add an optional timeout option for 'chronyd -q ...'

2016-12-01 Thread Lonnie Abelbeck

On Dec 1, 2016, at 6:47 AM, Miroslav Lichvar <mlich...@redhat.com> wrote:

> On Thu, Dec 01, 2016 at 06:30:22AM -0600, Lonnie Abelbeck wrote:
>> Certainly, If a cron job was used to periodically call chronyd instead of 
>> ntpdate, a "-t timeout_secs" option would be quite useful to make sure a 
>> stuck/delayed chronyd would not prevent later chronyd's from running.
> 
> I'd not recommend using a cron job, but rather something with random
> sleeps between the starts, so multiple clients are not sending
> requests at the same time. If you wanted it to correct frequency, it
> would have to be without the -q option as it can only step the clock
> without any adjustment of the frequency.

OK, thanks for the insight.


> 
>> Just to be clear, I would suggest chronyd should not return 0 if the timeout 
>> was reached and exited.
> 
> How about returning 0 if the clock was in a synchronised state (the
> reference was updated at least once) and 1 if not? With -q that would
> be 0 only if the clock was stepped.

Yes, that would work for our situation.

For example using "chronyd -q -u ntp -t 10", if after 5 seconds the clock was 
in a synchronized state, it steps the clock and exits 0.  Alternatively if 
after 10 seconds the clock was not yet in a synchronized state, it would exit 
with a non-zero (timeout) return.

Lonnie


> -- 
> Miroslav Lichvar
> 
> -- 



--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



Re: [chrony-users] Request: Add an optional timeout option for 'chronyd -q ...'

2016-12-01 Thread Lonnie Abelbeck
Hi Miroslav, (comments inline)

On Dec 1, 2016, at 5:20 AM, Miroslav Lichvar  wrote:

>> Does adding a "-t timeout" option to be used with "chronyd -q ..." sound 
>> reasonable ?  We would probably use -t 8 (in seconds) for the upper bound.
> 
> So you would be ok with chronyd not setting the clock? Why does it
> need to block the boot sequence then?

It is 'important' to have the clock accurately set (no stepping later) at boot 
before the services' daemons are started, but it is not 'critical' to do so

It is critical to not delay the boot process by more than a few seconds.  A "-t 
timeout_secs" option would guarantee that.


> I think a -t option might make sense in some cases, but I'm wondering
> if it rather should be a more general option to always exit after
> specified number of seconds instead of changing the behaviour of the
> -q/-Q option. I guess this could be useful with extremely long polling
> intervals. On systems with very limited memory chronyd could be
> periodically started for a short time with the -r option, and unlike
> ntpdate and other simple clients it would still be able to correct the
> frequency offset.

Certainly, If a cron job was used to periodically call chronyd instead of 
ntpdate, a "-t timeout_secs" option would be quite useful to make sure a 
stuck/delayed chronyd would not prevent later chronyd's from running.

Though, even in that case, I would expect the -q option would often be used, as 
the chronyd return value is often useful.

I personally don't see a case when starting chronyd as a daemon with a timeout 
would be useful, but you would have more insight into that than I would.  
Certainly a general timeout would be welcomed.

Just to be clear, I would suggest chronyd should not return 0 if the timeout 
was reached and exited.


Miroslav, thanks for considering adding a "-t timeout_secs" option.

Lonnie

> 
> -- 
> Miroslav Lichvar
> 
> -- 



--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.



[chrony-users] Request: Add an optional timeout option for 'chronyd -q ...'

2016-11-30 Thread Lonnie Abelbeck
HI,

We are in the process of moving from 'ntp' to 'chrony' for our open source 
project.

In a matter of a few hours, I have made the conversion, including testing by 
booting without a network connection, restart chrony every 10 seconds for a 
100+ times, etc .

I am very impressed with 'chrony' !

Though we have one issue uncovered during testing.

First, a little background, previously we used this sequence at boot time to 
set a big jump, then maintain the clock:

first="$(awk '/^server / { print $2; nextfile; }' /etc/ntpd.conf)"
...
sntp -S -t4 $first
...
ntpd -g -c /etc/ntpd.conf


This is how we are doing it now with chrony:

first="$(awk '/^(server|pool) / { print $2; nextfile; }' /etc/chrony.conf)"
...
chronyd -q -u ntp "server $first iburst"
...
chronyd -u ntp


What we would like is a "-t timeout" option to be used with "chronyd -q ..." 
just like sntp's -t option.  I have seen cases where "chronyd -q ..." hangs 
without a timeout.

The last thing we want to for chronyd to hang at boot time, and it can without 
such a timeout option, here are some logs...

2016-11-30T18:50:24Z chronyd version 2.4.1 starting (+CMDMON +NTP +REFCLOCK 
+RTC +PRIVDROP -SCFILTER -SECHASH +ASYNCDNS -IPV6 -DEBUG)
2016-11-30T18:50:24Z Initial frequency -17.442 ppm
2016-11-30T18:50:26Z Received KoD RATE from 138.68.46.177, burst sampling 
stopped
(Hung for minutes or longer, a ^C was require to continue)

2016-11-30T18:43:30Z chronyd version 2.4.1 starting (+CMDMON +NTP +REFCLOCK 
+RTC +PRIVDROP -SCFILTER -SECHASH +ASYNCDNS -IPV6 -DEBUG)
2016-11-30T18:43:30Z Initial frequency -15.827 ppm
2016-11-30T18:43:37Z Received KoD RATE from 67.4.147.175, burst sampling stopped
2016-11-30T18:47:57Z No suitable source for synchronisation
(Worked)

2016-11-30T19:11:01Z chronyd version 2.4.1 starting (+CMDMON +NTP +REFCLOCK 
+RTC +PRIVDROP -SCFILTER -SECHASH +ASYNCDNS -IPV6 -DEBUG)
2016-11-30T19:11:01Z Initial frequency -17.331 ppm
2016-11-30T19:11:01Z Received KoD RATE from 50.116.52.97, burst sampling stopped
(Hung for minutes or longer, a ^C was require to continue)

Does adding a "-t timeout" option to be used with "chronyd -q ..." sound 
reasonable ?  We would probably use -t 8 (in seconds) for the upper bound.

Thanks,
Lonnie





--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.