Re: [ntp:questions] ntpd on busybox ARM system not keeping time with server

2021-05-18 Thread Andreas Schick
David Woolley schrieb am Dienstag, 18. Mai 2021 um 13:58:46 UTC+2:
> On 18/05/2021 12:39, Andreas Schick wrote: 
> > I could safely remove the LCL entries and the server line where it lists 
> > own IPv4 address of the ARM box
> I think it is more accurate to say that you CANNOT safely keep these! 
> The self reference is plain wrong.

@David:Wooley: Thank you for confirming that. I was 'forced/asked' to set it up 
this way by one of my former colleagues, who is frankly speaking not really 
familiar with ntpd functionality. People here sadly (my employer) tend to 
assume stuff without exactly knowing the technical backgrounds. I think this 
idea initially came up because we are also using several of these ARM machines 
on one network and all of them are running ntpd and people used to always put 
all of them into server lines assuming they will get some strange sort of 
pooling redundancy or something. I still doubt it is the right way in that 
scenario and I'd rather prefer one server that is reasonably safe provided it 
is synced to some sort of outside world and has at least a battery buffered LCL.

Regarding w32time I know it is not the solution anyone using ntp mechanisms 
would prefer (me included), but at least it gives me some means of time 
syncronisation as the network is missing a real ntp timeserver (eiteher a 
dedicated device or a reliable linux server machine running 24/7). The windows 
workstation is actually a server machine running 24/7 and it is connected to 
the internet via a router and a secondary NIC. Sadly I had the mentioned router 
already failing or dropping the internet connection and that lead to the 
windows machine dropping to stratum 16 and then clients have to say goodbye to 
synchronisation. But this risk I currently have to take.

If I could I'd replace that windows host by some dedicated time server (e.g. 
the meinberg lantime series). But at the moment unfortunately I can not do that.

Another question I have is: does adding iburst to the server entry improve 
startup behavior of ntpd, as far as I saw it does not make much difference in 
my scenario, as I only have one accessible server on my network.
And as per the documents I read so far it just makes the server send out 
several requests in a shorter time period. I do not think it will improve the 
situation I am having in regards to startup, as it already seems to work fine 
now without it.

One further idea I had was just modifying some startup scripts (which run 
before ntpd process is started and after the network is up) to include some 
from of a ntpd-run-sync-and-quit or ntpdate call that steps the clock at system 
startup on the ARM device. I have to avoid stepping the system time during 
normal system runtime as timers in some software can misbehave if a leap in 
time is detected. But at the moment startup behavior seems fine after boot and 
the time just is not in sync after a couple of hours days of the system running.

Thank you for helping anyway.

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] ntpd on busybox ARM system not keeping time with server

2021-05-18 Thread Andreas Schick
Addition: After I reboot the embedded ARM system time is in sync with the 
windows box and ntp.log shows this:

# cat /tmp/ntp.2021-05-18T13\:29\:43\+0200.log
18 May 13:29:43 ntpd[1224]: proto: precision = 0.666 usec
18 May 13:29:43 ntpd[1224]: ntp_io: estimated max descriptors: 1024, initial 
socket boundary: 16
18 May 13:29:43 ntpd[1224]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
18 May 13:29:43 ntpd[1224]: Listen and drop on 1 v6wildcard :: UDP 123
18 May 13:29:43 ntpd[1224]: Listen normally on 2 lo 127.0.0.1 UDP 123
18 May 13:29:43 ntpd[1224]: Listen normally on 3 eth0 192.0.2.16 UDP 123
18 May 13:29:43 ntpd[1224]: Listen normally on 4 eth0:aka00 192.168.101.2 UDP 
123
18 May 13:29:43 ntpd[1224]: Listen normally on 5 eth0 fe80::205:51ff:fe0a:ef05 
UDP 123
18 May 13:29:43 ntpd[1224]: Listen normally on 6 lo ::1 UDP 123
18 May 13:29:43 ntpd[1224]: peers refreshed
18 May 13:29:43 ntpd[1224]: Listening on routing socket on fd #23 for interface 
updates
18 May 13:29:43 ntpd[1224]: 0.0.0.0 c016 06 restart
18 May 13:29:43 ntpd[1224]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
18 May 13:29:43 ntpd[1224]: 0.0.0.0 c011 01 freq_not_set
18 May 13:29:44 ntpd[1224]: 0.0.0.0 c514 04 freq_mode

Any advice would be helpful.
Sidenote: As per my understanding I could safely remove the LCL entries and the 
server line where it lists own IPv4 address of the ARM box. I know that under 
normal circumstances I should provide at least three server addresses. But this 
is not the case here as I just want to sync the box to one device 
(currentlywindows box) non the local LAN, that itself is synced to the outside 
world via internet or GPS or DCF or the like.

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


[ntp:questions] ntpd on busybox ARM system not keeping time with server

2021-05-18 Thread Andreas Schick
Greetings to the community,

I am struggling with some issue on a ARM based embedded system using linux with 
busybox binary and ntpd for synchrosnisation. From time to time system clock is 
out of sync in that local network.

1. There is a windows box (IPv4: 192.168.101.35) on the same LAN subnet which 
is synced to the outside world. The default gateway on that LAN (192.168.101.1) 
is not the router to the outside world.
2. This is intended but I may be able to configure additional routes on the 
embedded ARM device
3. The embedded ARM system (IPv4: 192.168.101.2) is synced to the windows box 
and does not have a proper LCL which is battery buffered or synced otherwise 
(GPS or DCF etc) so it drifts badly and starts up with bogus time upon boot.

The ARM system has the following ntp.conf.
 BEGIN paste ntp.conf
# /etc/ntp.conf - Configuration file for ntpd

##
## Undisciplined Local Clock. This is a fake driver intended for backup
## and when no outside source of synchronized time is available.
##
server 127.127.1.0  # local clock (LCL)
fudge  127.127.1.0 stratum 10   # LCL is unsynchronized

##
## Outside source of synchronized time.
## Uncomment when needed.
##
# IP address of server

##
## Miscellaneous stuff
##

#driftfile /etc/ntp.drift   # path for drift file
#driftfile /run/ntp.drift
#logfile   /var/log/ntp # alternate log file
#logfile /run/ntp.log
#logconfig =syncstatus + sysevents
 logconfig =all

# statsdir /rdisk/  # directory for statistics files
# filegen peerstats  file peerstats  type day enable
# filegen loopstats  file loopstats  type day enable
# filegen clockstats file clockstats type day enable
server  192.168.101.35
server  192.168.101.2

END paste ntp.conf - 

What I want to achieve is just the ARM system syncing itself to the windows 
box, that I maybe will swap out for a meinberg lantime device serving as a 
proper ntp-server in the future.

What I do not understand is is this all LCL stuff needed at all? And why is the 
servers section listing the system itself as a server? Does this make any sense 
in this configuration? To be honest I received this mess and have to figure out 
now how to get it to work. Googling gave nothing of value and the results I 
found were even sometimes controversial.

What I achieved so far:
1. ntpdate -q 192.168.101.35 yields correct time and intends to step clock as 
the  offset of the embedded ARM box is approx. 1 minute now compared to the 
windows box having startum 4 - following is the output:

 BEGIN
# ntpdate -q 192.168.101.35
server 192.168.101.35, stratum 4, offset 64.145311, delay 0.02582
18 May 13:20:07 ntpdate[9548]: step time server 192.168.101.35 offset 64.145311 
sec
 END

2. ntpd process seems running OK on startup, with ps showing:
ntpd -g -c /tmp/ntp.conf -f /tmp/ntp.2021-05-07T13:11:54+0200.drift -l 
/tmp/ntp.2021-05-07T13:11:54+0200.log

3. Logfile seems strange as the only output I see is dated to May 7th this year 
and I checked it today.

Please point me in the right direction, as I am out of ideas now.

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions