Page 1 of 1

KeyHelp UI need Update on TimeSync section.

Posted: Sun 26. Feb 2023, 15:14
by latifolia
STOP - Please read the next lines carefully!

1) Please fill out the post template below completely!
2) The members of this forum provide their valuable time to help! In return, please provide as much information as possible and be specific in your error description. Posts that show little initiative will probably not get good responses!

You may remove this top portion of the post template.
However, do not remove the following post template under any circumstances.
---------------------------------------------------------------------------


I'm sure the cause of the problem is within KeyHelp
(Problems not related to KeyHelp belong in the Offtopic forum)


Server operating system + version
Ubuntu 22.04


Server virtualization technology used
Amazon/AWS


KeyHelp version + build number
23 - Latest


Problem description / error messages

Clean install Ubuntu LTS 22 before installing latest Keyhelp will install Chrony as Time Sync. No longer install TimeSyncd.
Z.jpg
Expected result

Update UI of Keyhelp

Actual result


Steps to reproduce

Open https://DOMAIN/index.php?page=admin_services

Additional information
(e.g. recent changes to the server, excerpts from log files (/var/log/*, /var/log/keyhelp/php-error.log, etc.))

Re: KeyHelp UI need Update on TimeSync section.

Posted: Sun 26. Feb 2023, 15:39
by BasHeijermans
https://docs.aws.amazon.com/AWSEC2/late ... -time.html

Also your KeyHelp is outdated as we are on version 23 and not 22.

You may want to update the panel first.

Re: KeyHelp UI need Update on TimeSync section.

Posted: Sun 26. Feb 2023, 15:54
by latifolia
BasHeijermans wrote: Sun 26. Feb 2023, 15:39 https://docs.aws.amazon.com/AWSEC2/late ... -time.html

Also your KeyHelp is outdated as we are on version 23 and not 22.

You may want to update the panel first.
Sorry, I was wrong putting version in description. Here is my KeyHelp version :
Z.jpg

Re: KeyHelp UI need Update on TimeSync section.

Posted: Sun 26. Feb 2023, 16:55
by BasHeijermans
Just checked my server, I run NTPD instead of Chrony on my KeyHelp system.
You may want to switch to NTPD?

My system also doesn't contain TimeSyncd.
Schermafdruk op 2023-02-26 16-54-58.png
Schermafdruk op 2023-02-26 16-54-58.png (10.65 KiB) Viewed 2707 times
My sever shows this.

Re: KeyHelp UI need Update on TimeSync section.

Posted: Sun 26. Feb 2023, 17:02
by latifolia
Turns out, since Ubuntu 18, it has been defaulted and recommendec to use Chrony as TimeSync utility. Ubuntu 22 LTS also defaulted to use Chrony upon clean installation.

Source : https://ubuntu.com/blog/ubuntu-bionic-u ... figure-ntp

Whatever the choices, KeyHelp UI needs update.

Re: KeyHelp UI need Update on TimeSync section.  [SOLVED]

Posted: Mon 27. Feb 2023, 10:09
by Alexander
Ubuntu 22 LTS also defaulted to use Chrony upon clean installation.
I would argue this, as none of my test systems ever used chrony, instead of timesyncd (or in the past ntp).
I also "enforce" timesyncd, when updating to Ubuntu 22 / Debian 11 via the OS-upgrade scripts.

However, i added Chrony to the list on the corresponding page in KeyHelp now and hide it, if it is not installed. Also timesyncd is hidden now, if it is not installed.

Re: KeyHelp UI need Update on TimeSync section.

Posted: Mon 27. Feb 2023, 17:35
by BasHeijermans
Something to consider.

Chrony will only start inside a virtual machine when /etc/default/chrony has the '-x' option added to the configuration.
Else it will fail to start because most (if not all) Virtual machines won't allow the hw-time to be adjusted.

Alex you might consider testing for a virtual machine when adding Chrony and add the -x or we will see many people complain.

Update: After testing I found that chrony with -x parameter isn't serving time to clients. There is really no use for chrony inside a virtual machine.
Update2: My mistake, had to add:

Code: Select all

allow all
To the chrony.conf, now it serves all clients with time.

Re: KeyHelp UI need Update on TimeSync section.

Posted: Tue 28. Feb 2023, 09:41
by Alexander
Alex you might consider testing for a virtual machine when adding Chrony
I do not "add" Chrony. I only show it on the corresponding page if it is installed. This is only a visual thing, nothing more. There is no change in the "default" time sync service, as this is not handled by KeyHelp anyway (beside the switch from NTP to timesyncd when doing a dist upgrade to Ubuntu 22 / Debian 11).
Therefore also no need to test if Chrony works for the server or not, this is out of scope of KeyHelp.

Re: KeyHelp UI need Update on TimeSync section.

Posted: Tue 28. Feb 2023, 16:36
by BasHeijermans
Why not take time-servers out of keyhelp in total and just check if the system-time is correct compared to ntp-time?
This is easily enough.

I mean, check if the time is e.g. within 1 second accurate of UTC and just show a warning if it's way off.
As time is important for KeyHelp, cronjobs, automated tasks etc.

I mean, all that is needed is to run this:

Code: Select all

ntpdate -q pool.ntp.org
server 51.15.191.239, stratum 2, offset +0.001060, delay 0.03027
server 51.15.175.180, stratum 2, offset -0.001524, delay 0.03041
server 51.38.113.118, stratum 2, offset +0.000336, delay 0.03456
28 Feb 16:31:59 ntpdate[3476352]: adjust time server 51.15.191.239 offset +0.001060 sec
It will tell the offset, and if it can't reach a timeserver, there could be something wrong.

That is all there is needed to inform the admin if there could be a problem with time.
Regardless what time-keeping-software there is running or not running, this command will tell you if the time is good or bad.

Just an idea.

Re: KeyHelp UI need Update on TimeSync section.

Posted: Tue 28. Feb 2023, 17:29
by Alexander
BasHeijermans wrote: Tue 28. Feb 2023, 16:36 Why not take time-servers out of keyhelp
Sorry but I don't get what we are talking about. KeyHelp does not care, what time-sync services is installed, nor does it use it / installs it / etc. This is out of scope of KeyHelp, this is the task of the operating system / the time-sync software which ships with it. If it is systemd-timesyncd, ntp, chrony whatever.

KeyHelp only displays, which one is used, and if it is running - thats it.

(During OS-Upgrade, it just ensures, that the old ntp is removed in favor of the default systemd-timesyncd of more modern systems - thats it)

Re: KeyHelp UI need Update on TimeSync section.

Posted: Tue 28. Feb 2023, 17:41
by BasHeijermans
Hi Alex,

KeyHelp does rely on proper time, for it's tasks, like maintenance, cronjobs, etc.

So yes, it needs good time. But it doesn't rely on how good time is gotten.

That is what I mean.

So KeyHelp may want to check if the time is 'accurate' once a day, regardless who provides the time.

In short, check if the system-time is ok to proceed. That can be done with ntpdate as it will verify if the time and date is correct (within certain limites).

Test it on your own systems, run 'ntpdate -q pool.ntp.org' it will tell you if time is correct or not, all the rest doesn't matter.

And let the KeyHelp panel warn if time is off by x-seconds, admin configurable, as permanent servers will be correct within xx msec's, but poor servers may be off by 60 seconds.

How time is kept, true, KeyHelp has no point checking that, but the server should be on time, for time-tasks like main, cronjobs, certificates....to name a few.

Re: KeyHelp UI need Update on TimeSync section.

Posted: Wed 1. Mar 2023, 09:04
by Alexander
... and this is all done by systemd-timesyncd automatically, no need to call any commands.

Re: KeyHelp UI need Update on TimeSync section.

Posted: Sun 5. Mar 2023, 16:01
by BasHeijermans
Alexander wrote: Wed 1. Mar 2023, 09:04 ... and this is all done by systemd-timesyncd automatically, no need to call any commands.
Unless they turn it off and install Chrony like Ubuntu does.

Then it would be usefull fix it during installation or tell people in a VPS that it must be repaced by timesyncd.

One way or the other, Ubuntu isn't too smart to use in a VPS as it installs an impossible default time-keeper :lol: