Psync Time Synchroniser Version 2.9 & 2.7-64bit

Core libraries and systems
Message
Author
User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#121 Post by BarryK »

Sylvander wrote:For a long time now...
Been having a problem...
Display of time is nearly always 1 hour behind despite psync-2.10 being set to auto-sync.
I can use psync to correct the time, but at next boot, the time is again 1 hour behind.
Once in a while [1 in 50?], at the beginning of a new session, psync will auto-sync correctly, and the time is correct.
This is within Slacko-5.7.0-pae.
As I understand it, psync waits for Internet, but will timeout. So, if your Internet is not up soon enough, psync won't work.

It is awhile since I looked at it, but I think that is still how psync works.

Back in 2016 I developed Qsync, which waits indefinitely for the Internet to come up. This is for my fork of Puppy, Quirky Linux, and more recently EasyOS.

Porting Qsync to Puppy is possible, but some of the infrastructure is different, and it would involve some work.

It might be simpler just to look at the timeout in psync and set it to wait a bit longer.

For the curious, this was my original post about Qsync:

http://bkhome.org/news/201611/qsync-ntp-time-sync.html

though recently it has changed:
http://bkhome.org/news/201803/qsync-new ... nager.html
[url]https://bkhome.org/news/[/url]

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#122 Post by Sylvander »

1.
BarryK wrote:As I understand it, psync waits for Internet, but will timeout. So, if your Internet is not up soon enough, psync won't work.
Yes, once I saw that the time was wrong, and as I had only began to sync but nowhere near completed, the time magically corrected.
I concluded that auto-sync had somehow managed to auto-connect to the servers.
Thing is...
I normally power on my HUB, and wait for a long time before booting, and the internet connection is typically good once at the desktop.
Desktop PC connected to the hub by wire, very reliable.
Perhaps the above was only time I booted too soon.

2.
BarryK wrote:It might be simpler just to look at the timeout in psync and set it to wait a bit longer.
How?

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#123 Post by BarryK »

Sylvander wrote:2.
BarryK wrote:It might be simpler just to look at the timeout in psync and set it to wait a bit longer.
How?
Psync has /root/Startup/timesync.sh, which has "sleep 15" in it.

But I haven't looked at this for awhile, not sure if that is still the situation in latest Psync.

EDIT:
I just now downloaded psync 2.10 PET. It looks like there is a wait loop for wifi to be "up", however no wait loop for ethernet.

So, as far as I can see, if you are connected to internet via ethernet, it must be up immediately. timesync.sh calls psyncfunc immediately, which calls ntpdate to read the time from an ntp server.

So, you could install a sleep before the call to psyncfunc, or, always ensure that your ethernet is connected to internet when you power-on the pc.

Or, it is possible to write a simple wait-loop to test for active internet before calling psyncfunc.

I remember now, I was using the RPI years ago, with Psync, and ethernet, hit this problem.
[url]https://bkhome.org/news/[/url]

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#124 Post by Sylvander »

1.
BarryK wrote:Psync has /root/Startup/timesync.sh, which has "sleep 15" in it.
It does indeed have this included.

2.
BarryK wrote:...you could install a sleep before the call to psyncfunc...
Wouldn't know where to place that or how to word/code it.
Would need detailed instructions.

3.
BarryK wrote:or, always ensure that your ethernet is connected to internet when you power-on the pc.
I always do.

4.
BarryK wrote:it is possible to write a simple wait-loop to test for active internet before calling psyncfunc
Seems simple to you I bet, but it's like rocket science to me.

5.
BarryK wrote:I remember now, I was using the RPI years ago, with Psync, and ethernet, hit this problem.
Was any solution found, to the problem, at that time?

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#125 Post by BarryK »

Sylvander wrote:1.
BarryK wrote:Psync has /root/Startup/timesync.sh, which has "sleep 15" in it.
It does indeed have this included.

2.
BarryK wrote:...you could install a sleep before the call to psyncfunc...
Wouldn't know where to place that or how to word/code it.
Would need detailed instructions.

3.
BarryK wrote:or, always ensure that your ethernet is connected to internet when you power-on the pc.
I always do.

4.
BarryK wrote:it is possible to write a simple wait-loop to test for active internet before calling psyncfunc
Seems simple to you I bet, but it's like rocket science to me.

5.
BarryK wrote:I remember now, I was using the RPI years ago, with Psync, and ethernet, hit this problem.
Was any solution found, to the problem, at that time?
Well, everything should be ok if you have the router powered up well before turning on the computer.

Just keep that habit, and no need to fix anything.

If you do want psync to wait a bit, in /root/Startup/timesync.sh, insert a line "sleep 15", or however long you want to sleep, just before the line "psyncfunc"
-- that will delay the time-sync a bit.

Regarding point-5, I had the situation where internet was not always up when bootup, so Psync failed. My solution was to develop Qsync.
[url]https://bkhome.org/news/[/url]

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#126 Post by Sylvander »

1.
BarryK wrote:Well, everything should be ok if you have the router powered up well before turning on the computer.
"Everything should be ok" perhaps, but unfortunately it isn't ok, since it fails to auto-sync, even after the "Virgin Hub"->[router+modem in one unit] has been powered-on for a LOOOOONG time.

2.
BarryK wrote:If you do want psync to wait a bit, in /root/Startup/timesync.sh, insert a line "sleep 15", or however long you want to sleep, just before the line "psyncfunc"
-- that will delay the time-sync a bit.
"sleep 15" is already included...
I'll increase it to "sleep 20", and if that fails to fix, increase it to "sleep 25".
-----------------------------------------------------------------------------------------------------------
Tried that...failed...increased to 30 sec...still failed. :(
[I saved the change to the file, then saved the change to the pupsave, then rebooted and again saved the change to the pupsave during shutdown->reboot.]

Post Reply