NTP force sync option
Pr2 22 jul 2021
Hi,
I have started a box without any DVB cable nor network cable connected to it.
So the box start in 1/1/1970 (which is normal) then I realized that I didn't connect the network so I plug the network cable in. Time in the box remains in 1970 so I perform a network test and it was fine.
I them go into the set timezone menu in OpenPLi but i could not find any way to force a new NTP sync.
Menu > Parameters > System > GUI parameter > Timezone
Would be nice to have a button there to force a NTP sync (for example press Yellow will force a NTP timesync).
My only solution was to reboot the box to have time taken from the NTP at boot.
Pr2
WanWizard 22 jul 2021
That shouldn't be the case, perhaps you're missing something due to long time updates or auto restores?
You should have:
lrwxrwxrwx 1 root root 21 Jul 14 12:55 /etc/network/if-up.d/ntpdate-sync -> /usr/bin/ntpdate-sync
which should do an ntpdate sync as soon as the network goes up;
-rw-r--r-- 1 root root 158 Jul 5 13:14 /etc/default/ntpdate
which contains the default ntp server to sync with, and;
-rw-r--r-- 1 root root 43 Jul 13 19:54 /var/spool/cron/root
containing
30 * * * * /usr/bin/ntpdate-sync silent
which keeps the time in sync by updating every 30 minutes.
Pr2 23 jul 2021
The box is clean it was flashed the 11 july and update online, yesterday.
No autorestore at all just install autobouquet maker to create favorite for testing.
The test box is the Qviart lunix 4K. I can reproduce the problem, here are evidence that the box is running without the correct time.
openpli develop lunix4k lunix4k login: root root@lunix4k:~# uptime 01:10:04 up 9 min, load average: 0.91, 0.79, 0.43 root@lunix4k:~# date Thu Jan 1 01:10:06 CET 1970 root@lunix4k:~# ifconfig eth0 Link encap:Ethernet HWaddr 0C:C6:AC:02:F4:52 inet addr:192.168.31.111 Bcast:192.168.31.255 Mask:255.255.255.0 inet6 addr: fe80::ec6:acff:fe02:f452/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:566 errors:0 dropped:1 overruns:0 frame:0 TX packets:173 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:108338 (105.7 KiB) TX bytes:23774 (23.2 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:2 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:140 (140.0 B) TX bytes:140 (140.0 B) root@lunix4k:~# crontab -l crontab: can't open 'root': No such file or directory root@lunix4k:~# cat /var/spool/cron/root 30 * * * * /usr/bin/ntpdate-sync silent root@lunix4k:~# ls /etc/default/ntpdate /etc/default/ntpdate root@lunix4k:~# ls /etc/network/if-up.d/ntpdate-sync /etc/network/if-up.d/ntpdate-sync root@lunix4k:~# date Thu Jan 1 01:15:22 CET 1970 root@lunix4k:~# uptime 01:15:27 up 15 min, load average: 0.81, 0.85, 0.57
Veranderd door Pr2, 23 juli 2021 - 19:33
Pr2 23 jul 2021
root@lunix4k:~# /usr/bin/ntpdate-sync root@lunix4k:~# date Thu Jan 1 01:17:01 CET 1970 root@lunix4k:~# date Fri Jul 23 20:34:31 CEST 2021So the command is working but it seems that the script is not launched when the network became up with pluging in the network cable.
It is nice to try to setup something automatic but I am still convinced that adding a Yellow button to force NTP sync is needed to easily work-around such situation.
Veranderd door Pr2, 23 juli 2021 - 19:38
WanWizard 23 jul 2021
Maybe, but unrelated to why it doesn't work.
Does this
/etc/network/if-up.d/ntpdate-sync -> /usr/bin/ntpdate-sync
symlink exist?
Can you add some debug logging to it, so we can check if it is called? And if ifconfig shows an IP at that point?
Also, I need to update crontab I see, it's looking in the wrong location.
Pr2 24 jul 2021
Yes it exists:
ls -Falh /etc/network/if-up.d/ntpdate-sync lrwxrwxrwx 1 root root 21 Jan 1 1970 /etc/network/if-up.d/ntpdate-sync -> /usr/bin/ntpdate-sync*I will take a log later on.
Veranderd door Pr2, 24 juli 2021 - 10:39
jpuigs 24 jul 2021
...but I am still convinced that adding a Yellow button to force NTP sync is needed to easily work-around such situation.
Me too....
Old time-sync plugin had a "sync now" button
jort38 24 jul 2021
Still has: third from bottom...but I am still convinced that adding a Yellow button to force NTP sync is needed to easily work-around such situation.
Me too....
Old time-sync plugin had a "sync now" button
Pr2 24 jul 2021
Still has: third from bottom
...but I am still convinced that adding a Yellow button to force NTP sync is needed to easily work-around such situation.
Me too....
Old time-sync plugin had a "sync now" button
There is no more needs for a 3rd party tools to have NTP support so please show us a screenshot where you can force a NTP sync in OpenPLi? I guess you are still refering to the systemtime plugin which is not installed in OpenPLi develop since it is no longer needed.
jort38 24 jul 2021
Still has: third from bottom...but I am still convinced that adding a Yellow button to force NTP sync is needed to easily work-around such situation.
Me too....
Old time-sync plugin had a "sync now" button
There is no more needs for a 3rd party tools to have NTP support so please show us a screenshot where you can force a NTP sync in OpenPLi? I guess you are still refering to the systemtime plugin which is not installed in OpenPLi develop since it is no longer needed.
Sorry, this topic is about the test version. I responded about release 8.0 version.
My bad.
el bandido 24 jul 2021
Adding a new WLAN device caused ntp to quit working. Internet is still working on the second WLAN device. A reboot does not help.
el bandido 24 jul 2021
Adding a new WLAN device caused ntp to quit working. Internet is still working on the second WLAN device. A reboot does not help.
Bijgevoegde Bestanden
WanWizard 24 jul 2021
Shouldn't make any difference with regards to running ntpdate-sync or the if-up scripts.
It could be a problem if the interface is "half up" and has broken IP routing, for example by overriding or erasing the default gateway.
Rudi1 15 aug 2021
This new system time still not work correct.Today I flash latest version and start box with working network and with iptv channel only but time is not update
only when I swith to satellite channel the time is updated.
WanWizard 16 aug 2021
Assuming "latest version" is the latest nightly build: did you restore an autobackup?
Can you reboot the box, and tell me what the output is of:
cat /etc/default/ntpdate ls -l /etc/network/if-up.d/ ls -l /usr/bin/ntp* ls -l /usr/sbin/ntp* grep ntp /var/log/messages
Rudi1 16 aug 2021
yes,is the latest nightly build.
openpli develop osmio4k osmio4k login: root Password: Last login: Thu Jan 1 01:12:19 CET 1970 on pts/0 root@osmio4k:~# cat /etc/default/ntpdate # Configuration script used by ntpdate-sync script NTPSERVERS="pool.ntp.org" # Set to "yes" to write time to hardware clock on success UPDATE_HWCLOCK="no" root@osmio4k:~# ls -l /etc/network/if-up.d/ lrwxrwxrwx 1 root root 21 Aug 14 2021 ntpdate-sync -> /usr/bin/ntpdate-sync lrwxrwxrwx 1 root root 32 Aug 14 2021 wpa-supplicant -> ../../wpa_supplicant/ifupdown.sh root@osmio4k:~# ls -l /usr/bin/ntp* -rwxr-xr-x 1 root root 1117 Aug 3 2021 /usr/bin/ntpdate-sync root@osmio4k:~# ls -l /usr/sbin/ntp* lrwxrwxrwx 1 root root 19 Aug 14 2021 /usr/sbin/ntpd -> /bin/busybox.nosuid -rwxr-xr-x 1 root root 133092 Aug 3 2021 /usr/sbin/ntpdate root@osmio4k:~# grep ntp /var/log/messages Jan 1 01:00:22 osmio4k user.info kernel: Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) Aug 16 08:09:43 osmio4k daemon.notice ntpdate[582]: step time server 89.212.9.180 offset 1629094155.884915 sec root@osmio4k:~#
Veranderd door Rudi1, 16 augustus 2021 - 07:28
Pr2 16 aug 2021
I also have a strange feeling with the network access after a fresh flash (it also seems to me that the network is not always started).
Since I have some doubt, I go into the Expert menu - Network and perform a network test and then everything is successful.
Ensure that you didn't install the old system time plugin (I think it should be removed from the feed if possible) because people doing an autorestore can perhaps have it re-installed automatically.
So after you flash are you still able to connect to the box in ssh or telnet?
you can check in the About screen the IP address received by the box.
Can you try in command line:
nslookup ntp.pool.orgCan you also test this because I find it in the NTP startup script so if the returned value is wrong then NTP won't work.
grep "config.ntp.server" /etc/enigma2/settings | cut -d"=" -f 2
Veranderd door Pr2, 16 augustus 2021 - 09:24
Dimitrij 16 aug 2021
Ensure that you didn't install the old system time plugin (I think it should be removed from the feed if possible) because people doing an autorestore can perhaps have it re-installed automatically.
system time plugin use auto start ntpdate only manual save this setting.
Veranderd door Dimitrij, 16 augustus 2021 - 10:12
Rudi1 16 aug 2021
I didn't install any plugin and I can access to the box(ftp,telnet,web..)After several hours the time is still at 1970.
openpli develop osmio4k osmio4k login: root Password: Last login: Thu Jan 1 01:13:59 CET 1970 on pts/0 root@osmio4k:~# nslookup ntp.pool.org Server: 192.168.88.1 Address: 192.168.88.1:53 Non-authoritative answer: Name: ntp.pool.org Address: 64.99.80.121 Non-authoritative answer: root@osmio4k:~#
after this command nothing happend
root@osmio4k:~# grep "config.ntp.server" /etc/enigma2/settings | cut -d"=" -f 2 root@osmio4k:~#
WanWizard 16 aug 2021
root@osmio4k:~# grep ntp /var/log/messages Jan 1 01:00:22 osmio4k user.info kernel: Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) Aug 16 08:09:43 osmio4k daemon.notice ntpdate[582]: step time server 89.212.9.180 offset 1629094155.884915 sec root@osmio4k:~#
This clearly shows that it did call ntpdate when the network became live, and it did set the correct date?