Thanks.Here you go!
I can't discover them in a shell script...Maybe including PID's in the logs will help debugging?
It's set to the pid of the current process, but I don't need to know that - I'm tracking other processes.It's such a long time ago now, but isn't $$ set to the PID?
It's certainly incompatible with the way the script is now used.Also, I see you have the lockfile-create program installed. I suspect this is now delaying the time setting....but I have to look at what it actually does (it's usage is odd).
Thanks.
What version of Vix are you running? Could you look at the top of the enigma2.sh script and see whether the call to ntpdate is commented out?
Also, I see you have the lockfile-create program installed. I suspect this is now delaying the time setting....but I have to look at what it actually does (it's usage is odd).
It (or rather, ntpdate-sync) is called by the enigma2 binary shortly after it starts, and every 30 mins thereafter if you are using NTP (rather than transponder) time.enigma2.sh script has the call to ntpdate commented out. This is why I have have asked several times in this thread where ntpdate is being called, apart from the ntpdate-sync script. I couldn't understand why there were multiple calls to ntpdate being made if there was a locking mechanism in place.
It isn't installed by default, but is available.SpaceRat amended the build files to include "lockfile-create" because it wasn't included by default in ViX,
Unfortunetely that's not what the code actually does. All it does is queue calls, and doesn't abort an attempt that times out but rather lets it run on...but is referenced in ntpdate-sync to ensure that ntpdate is not fired twice
That is not atomic (it has a trivial race condition) which is why you need to use a separate executable (to use the link() system call, which is atomic).I'm not sure why you would need a separate "lockfile-create" script, though? I've seen other uses where the calling script checks for the existence of a lockfile and if not present, just creates one by using the touch command and then deletes it when finished.
Ah. It wasn't installed the last time I looked, but it is now....It isn't installed by default, but is available.
On further thinking it might not, but it will tidy things up.I think this may speed up your NTP syncing...
Jan 29 17:12:52 mutant51 daemon.info avahi-daemon[2009]: Found user 'avahi' (UID 999) and group 'avahi' (GID 999).
Jan 29 17:12:52 mutant51 daemon.info avahi-daemon[2009]: Successfully dropped root privileges.
Jan 29 17:12:52 mutant51 daemon.info avahi-daemon[2009]: avahi-daemon 0.6.32 starting up.
Jan 29 17:12:52 mutant51 daemon.err avahi-daemon[2009]: dbus_bus_get_private(): Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Jan 29 17:12:52 mutant51 daemon.warn avahi-daemon[2009]: WARNING: Failed to contact D-Bus daemon.
Jan 29 17:12:52 mutant51 daemon.info avahi-daemon[2009]: avahi-daemon 0.6.32 exiting.
Jan 30 10:34:25 mutant51 daemon.notice ntpdate[2055]: step time server 192.168.0.190 offset 62492.527261 sec
Jan 30 10:34:32 mutant51 daemon.crit automount[1977]: key "logs" not found in map source(s).
Jan 30 10:34:35 mutant51 daemon.notice ntpdate[2072]: adjust time server 192.168.0.190 offset -0.001282 sec
Jan 30 10:34:43 mutant51 daemon.notice ntpdate[2127]: adjust time server 192.168.0.190 offset 0.000312 sec
Jan 30 11:04:49 mutant51 daemon.notice ntpdate[3173]: adjust time server 192.168.0.190 offset -0.011923 sec
Jan 30 11:34:55 mutant51 daemon.notice ntpdate[4151]: adjust time server 192.168.0.190 offset -0.001563 sec
Jan 30 12:05:01 mutant51 daemon.notice ntpdate[5129]: adjust time server 192.168.0.190 offset -0.005702 sec
Jan 30 12:35:08 mutant51 daemon.notice ntpdate[6120]: adjust time server 192.168.0.190 offset -0.005411 sec
ntpdate-sync [Mon Jan 29 17:12:44 GMT 2018]: called with
ntpdate-sync [Mon Jan 29 17:12:44 GMT 2018]: ifup call ignored (loopback/lo)...
ntpdate-sync [Mon Jan 29 17:12:49 GMT 2018]: called with
ntpdate-sync [Mon Jan 29 17:12:49 GMT 2018]: ifup call ignored (dhcp/wlan0)...
time-setter [Mon Jan 29 17:12:49 GMT 2018]: start called
ntpdate-sync [Mon Jan 29 17:12:49 GMT 2018]: called with -fg -q -abs
ntpdate-sync [Mon Jan 29 17:12:49 GMT 2018]: calling ntpdate -p 1 -b -s 192.168.0.190
ntpdate-sync [Mon Jan 29 17:12:51 GMT 2018]: ntpdate exit code 1
time-setter [Mon Jan 29 17:12:53 GMT 2018]: retrying
ntpdate-sync [Mon Jan 29 17:12:53 GMT 2018]: called with -fg -q -abs
ntpdate-sync [Mon Jan 29 17:12:53 GMT 2018]: calling ntpdate -p 1 -b -s 192.168.0.190
ntpdate-sync [Tue Jan 30 10:34:25 GMT 2018]: ntpdate succeeded
ntpdate-sync [Tue Jan 30 10:34:25 GMT 2018]: ntpdate exit code 0
ntpdate-sync [Tue Jan 30 10:34:27 GMT 2018]: called with
ntpdate-sync [Tue Jan 30 10:34:27 GMT 2018]: calling ntpdate -s 192.168.0.190
ntpdate-sync [Tue Jan 30 10:34:27 GMT 2018]: ntpdate exit code 0
ntpdate-sync [Tue Jan 30 10:34:32 GMT 2018]: called with
ntpdate-sync [Tue Jan 30 10:34:32 GMT 2018]: ntpdate exit code 0
ntpdate-sync [Tue Jan 30 10:34:35 GMT 2018]: ntpdate succeeded
ntpdate-sync [Tue Jan 30 10:34:37 GMT 2018]: calling ntpdate -s 192.168.0.190
ntpdate-sync [Tue Jan 30 10:34:43 GMT 2018]: ntpdate succeeded
ntpdate-sync [Tue Jan 30 11:04:43 GMT 2018]: called with
ntpdate-sync [Tue Jan 30 11:04:43 GMT 2018]: ntpdate exit code 0
ntpdate-sync [Tue Jan 30 11:04:43 GMT 2018]: calling ntpdate -s 192.168.0.190
ntpdate-sync [Tue Jan 30 11:04:49 GMT 2018]: ntpdate succeeded
ntpdate-sync [Tue Jan 30 11:34:49 GMT 2018]: called with
ntpdate-sync [Tue Jan 30 11:34:49 GMT 2018]: ntpdate exit code 0
ntpdate-sync [Tue Jan 30 11:34:49 GMT 2018]: calling ntpdate -s 192.168.0.190
ntpdate-sync [Tue Jan 30 11:34:55 GMT 2018]: ntpdate succeeded
ntpdate-sync [Tue Jan 30 12:04:55 GMT 2018]: called with
ntpdate-sync [Tue Jan 30 12:04:55 GMT 2018]: ntpdate exit code 0
ntpdate-sync [Tue Jan 30 12:04:55 GMT 2018]: calling ntpdate -s 192.168.0.190
ntpdate-sync [Tue Jan 30 12:05:01 GMT 2018]: ntpdate succeeded
Everyone filing tax returns at (almost) the last minute?Sort of surprised that there are NO new posts anywhere on the forum since last night!
Not sure whether that's good or bad. I'd like to know why it was taking >80s before.Ran with the new ntpdate-sync this morning with no issues. In fact, on both boots this morning the time updated within the first 20 seconds of the boot and the logs have the correct current date and time in the filename.
Well, there is a bug there, but not quite the one I expected.I'll also check what I think is a bug that having changed you NTP server from pool.ntp.org you can never set it back. The fix would be to remove ~2 lines of code.
NTPSERVERS="pool.ntp.or"
Ahh!!!!Well, there is a bug there, but not quite the one I expected.
I was expecting that if you changed your NTP server to something other than [FONT=courier\ new]pool.ntp.org[/FONT] in the enigma2 menus then any attempt to reset it to [FONT=courier\ new]pool.ntp.org[/FONT] wouldn't do anything, as NTPserverChanged() in [FONT=courier\ new]mytest.py[/FONT] just returns for that case and doesn't edit [FONT=courier\ new]/etc/default/ntpdate[/FONT].
However, that's not what happens. In practice if you reset the menu item to [FONT=courier\ new]pool.ntp.org[/FONT] the [FONT=courier\ new]/etc/default/ntpdate[/FONT] file ends up with:
i.e. the final "g" is missing!Code:NTPSERVERS="pool.ntp.or"
No idea how that comes about....yet.
...for which I now have a fix.So, for a simple menu entry, it's a mess.
https://github.com/OpenViX/enigma2/pull/211