Bug 1188980 - Multiple pool entries in chrony configuration at install
Multiple pool entries in chrony configuration at install
Status: CONFIRMED
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: YaST2
Leap 15.3
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Michal Filka
Jiri Srain
https://trello.com/c/lAINPFUm
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-08-02 13:25 UTC by andrew elwell
Modified: 2022-04-19 13:05 UTC (History)
6 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrew elwell 2021-08-02 13:25:13 UTC
A fresh installation of a openSUSE leap (15.3) as a server resulted in chrony tracking 18 time sources

localhost:~ # chronyc sources | head -n 1
210 Number of sources = 18

These are coming from two places - The first (expected) is via the chrony-pool-openSUSE

localhost:~ # cat /etc/chrony.d/pool.conf
pool 2.opensuse.pool.ntp.org iburst
localhost:~ # rpm -qf /etc/chrony.d/pool.conf
chrony-pool-openSUSE-3.2-9.24.2.noarch
localhost:~ #

however it looks like something at install time alters the standard chrony.conf
localhost:~ # rpm -V chrony
S.5....T.  c /etc/chrony.conf


and adds multiple "pool" entries in a manner which looks like something that originally used "server" entries

localhost:~ # grep ^pool /etc/chrony.conf
pool 0.suse.pool.ntp.org iburst
pool 1.suse.pool.ntp.org iburst
pool 2.suse.pool.ntp.org iburst
pool 3.suse.pool.ntp.org iburst
localhost:~ #

I think this could be related to #1180689 and #1172517 - but I can't work out what takes the server list generated by https://github.com/yast/yast-network/blob/master/src/lib/y2network/ntp_server.rb and adds them to the config.


IMHO, the solution is not to add any pool entries into chrony.conf if already using the include /etc/chrony.d/*.conf method. 
If they _do_ need to be added, one pool entry should be enough.
Comment 1 Marcus Meissner 2021-08-05 12:39:07 UTC
probably filled in by yast2
Comment 2 Knut Alejandro Anderssen González 2021-08-05 15:13:50 UTC
Yep, looks like related to https://bugzilla.suse.com/show_bug.cgi?id=1180699 and already tracked by https://trello.com/c/HtBLfvR0/4499-3-ostumbleweed-p5-1180699-microos-defaults-to-using-the-suse-ntp-pool which is in the incoming board.
Comment 4 Knut Alejandro Anderssen González 2021-09-07 15:02:57 UTC
With yast2-network-4.4.23 it will configure only one pool from the default list of sources (https://github.com/yast/yast-country/pull/282).

But that means there will be at least two pools, the YaST one configured in /etc/chrony.conf and the other one provided by the chrony-pool-openSUSE RPM.

The current YaST dialog models ignores anything under /etc/chrony.d so, it does not about the pools configured there and thus, them are not exposed in order to sync the time with the dialog.

So, this looks like an enhancement for changing the current behavior, I will create a separate PBI in order to address it.
Comment 5 Knut Alejandro Anderssen González 2021-09-08 08:50:58 UTC
I have created a separate PBI in order to address this issue as it needs some discussions / agreements.
Comment 6 Josef Reidinger 2021-09-24 12:38:31 UTC
Reinhard: We discussed this within a team and basically we have ideas how to fix it, but also we would like to verify it with you as you introduce that branding pools packages.

So installation use-cases:

1. user wants distro defaults. In such case I think it makes sense to ensure that branding pool is installed ( so force install of chrony-pool-nonempty ) and ensure that chrony service is enabled and do nothing beside that.

2. user wants his own ntp server to be used. In such case we should force chrony-pool-empty and write to /etc/chrony.d/pool.conf server user wants to use.

3. user do not want ntp sync - in such case do not install chrony.

And second case is modifications on running system. Reading is easy case as we can read all entries and read pool from it, but big topic is how to handle changes. What do you recommend to do? Remove pool keys from all configs and just use pool.conf? or disable touching of pools outside of pool.conf? And what about old chrony config in chrony.conf when user migrate?
Comment 9 Joerg Frede 2021-12-15 15:22:35 UTC
In my opinion /etc/chrony.conf should not contain any pools because we have defined a pool in /etc/chrony.d/pool.conf so this is doubled. 
In the default install we have now 4 pools in /etc/chrony.conf and one in /etc/chrony.d/pool.conf each is providing 4 Servers so we have 20 Servers which is way to much and loads ntp.org more then necessary.