Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New chrony.conf option leapseclist unsupported by chrony lens #840

Closed
flo-renaud opened this issue Aug 5, 2024 · 0 comments · Fixed by #843
Closed

New chrony.conf option leapseclist unsupported by chrony lens #840

flo-renaud opened this issue Aug 5, 2024 · 0 comments · Fixed by #843

Comments

@flo-renaud
Copy link

With fedora 41, chrony-4.6-0.1.pre1.fc41 is shipped and provides a new option leapseclist with a default value in /etc/chrony.conf that render the lens unusable.
The default /etc/chrony.conf contains:

# Set the TAI-UTC offset of the system clock.
leapseclist /usr/share/zoneinfo/leap-seconds.list

and this option breaks augeas. In order to reproduce, use the following python script:

from augeas import Augeas
import os

aug = Augeas(flags=Augeas.NO_LOAD | Augeas.NO_MODL_AUTOLOAD)
module = "chrony"
chrony_conf = os.path.abspath("/etc/chrony.conf")
aug.transform(module, chrony_conf)  # loads chrony lens file
aug.load()  # loads augeas tree

path = '/files{path}'.format(path=chrony_conf)

# remove possible conflicting configuration of servers
aug.remove('{}/server'.format(path))
aug.remove('{}/pool'.format(path))
aug.remove('{}/peer'.format(path))

aug.set('{}/pool[last()+1]'.format(path), "1.pool.ntp.org")
aug.set('{}/pool[last()]/iburst'.format(path), None)

aug.save()

The script fails to save chrony.conf:

# python3 /tmp/test_augeas.py
Traceback (most recent call last):
  File "/tmp/test_augeas.py", line 20, in <module>
    aug.save()
    ~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/augeas/__init__.py", line 607, in save
    self._raise_error(AugeasIOError, "Augeas.save() failed")
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/augeas/__init__.py", line 154, in _raise_error
    raise errorclass(ec, fullmessage, msg, minor, details)
augeas.AugeasIOError: Augeas.save() failed: No error

If /etc/chrony.conf is manually edited in order to remove the option leapseclist, then the script succeeds.

Installed packages:

augeas-libs-1.14.1-2.fc41.x86_64
python3-augeas-1.1.0-14.fc41.noarch
chrony-4.6-0.1.pre1.fc41.x86_64
tupyy added a commit to tupyy/augeas that referenced this issue Aug 7, 2024
This commit adds support for "leapseclist" option.

Fixes: hercules-team#840

Signed-off-by: Cosmin Tupangiu <[email protected]>
georgehansper pushed a commit that referenced this issue Aug 14, 2024
This commit adds support for "leapseclist" option.

Fixes: #840

Signed-off-by: Cosmin Tupangiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant