Feature #24290
closedUse chronyd instead of ntp in provisioning templates on RHEL systems
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1601602
Description of problem: In the current default provisioning templates there is a step to do an initial time sync using ntpdate:
```
#update local time
echo "updating system time"
/usr/sbin/ntpdate -sub <%= host_param('ntp-server') || '0.fedora.pool.ntp.org' %>
/usr/sbin/hwclock --systohc
```
In order for this to work the ntp package is also installed in the %packages system since is not install in rhel by default.
From my understanding this line is just to do a quick initial sync. chronyd has an option to do this [1].
Most of our docs are (or are being updated to) prefer chrony [2].
So rather then install the ntp package to just use ntpdate once, we should probably consider using the 'chronyd -q' option.
[1] https://chrony.tuxfamily.org/faq.html#_does_code_chronyd_code_have_an_ntpdate_mode
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1589712
Updated by Aditi Puntambekar over 6 years ago
- Subject changed from Use chronyd instead of ntp in provisioning templates on RHEL systems to Use chronyd instead of ntp in provisioning templates on RHEL systems
Hello, are we planning to implement this feature by introducing chronyd ?
Updated by Lukas Zapletal over 6 years ago
I don't agree with a simple replacement, there are features which are better in chrony and feature better in the original ntpd. They are both available on most systems, including RHEL7, we should have templates with both and let user to decide.
Updated by Aditi Puntambekar over 6 years ago
Lukas Zapletal wrote:
I don't agree with a simple replacement, there are features which are better in chrony and feature better in the original ntpd. They are both available on most systems, including RHEL7, we should have templates with both and let user to decide.
So, should we install chrony and ntp both ? Also, how should chrony -q
be then used along with ntpdate
?
Updated by Lukas Zapletal over 6 years ago
We should default to chrony but when there is host parameter passed ntp-service and set to "ntpd" then we should use ntpd. Something like that IMHO.
Updated by Aditi Puntambekar over 6 years ago
So does this mean if a host parameter say, ntp-service: string (default="ntpd") is passed, it should use ntpd, right? But, since this is already set to ntpd then how will it default to chrony ?
Updated by Lukas Zapletal over 6 years ago
- Status changed from New to Closed
- Assignee changed from Aditi Puntambekar to Stephen Benjamin
- Difficulty set to easy
- Triaged changed from No to Yes
- Pull request https://github.com/theforeman/community-templates/pull/530 added
This patch https://github.com/theforeman/community-templates/pull/530 introduced new option:
use_ntp = host_param_true?('use-ntp') || (is_fedora && os_major < 16) || (rhel_compatible && os_major <= 7)
Our templates are now compatible with boths, default to chrony on modern systems. This is overrideable via use-ntp option.
Updated by Tomer Brisker about 6 years ago
- Fixed in Releases 1.20.1, 1.21.0 added