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

Wrong service name used for chrony when restarting service #3756

Closed
ubuntu-server-builder opened this issue May 12, 2023 · 3 comments
Closed
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1885952

Launchpad details
affected_projects = []
assignee = raharper
assignee_name = Ryan Harper
date_closed = 2022-08-19T16:37:02.584799+00:00
date_created = 2020-07-01T19:28:55.375682+00:00
date_fix_committed = 2022-08-19T16:37:02.584799+00:00
date_fix_released = 2022-08-19T16:37:02.584799+00:00
id = 1885952
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1885952
milestone = None
owner = loci
owner_name = Lorant Nemeth
private = False
status = fix_released
submitter = loci
submitter_name = Lorant Nemeth
tags = []
duplicates = []

Launchpad user Lorant Nemeth(loci) wrote on 2020-07-01T19:28:55.375682+00:00

service is called chronyd and not chrony in CentOS/RH. Have been tested with lated CentOS cloud image + all latest updates (with epel enabled).

[root@myhostname ~]# uname -a
Linux myhostname 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@myhostname ~]# cat /etc/centos-release
CentOS Linux release 7.8.2003 (Core)

[root@myhostname ~]# cloud-init single --name cc_ntp
Cloud-init v. 18.5 running 'single' at Wed, 01 Jul 2020 19:16:33 +0000. Up 54.51 seconds.
2020-07-01 19:16:34,023 - cc_ntp.py[ERROR]: Failed to reload/start ntp service: Unexpected error while running command.
Command: ['systemctl', 'reload-or-restart', 'chrony']
Exit code: 5
Reason: -
Stdout:
Stderr: Failed to reload-or-restart chrony.service: Unit not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cloudinit/config/cc_ntp.py", line 547, in handle
systemd=cloud.distro.uses_systemd())
File "/usr/lib/python2.7/site-packages/cloudinit/config/cc_ntp.py", line 436, in reload_ntp
util.subp(cmd, capture=True)
File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 2084, in subp
cmd=args)
ProcessExecutionError: Unexpected error while running command.
Command: ['systemctl', 'reload-or-restart', 'chrony']
Exit code: 5
Reason: -
Stdout:
Stderr: Failed to reload-or-restart chrony.service: Unit not found.
2020-07-01 19:16:34,025 - util.py[WARNING]: Running module cc_ntp (<module 'cloudinit.config.cc_ntp' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_ntp.pyc'>) failed
2020-07-01 19:16:34,040 - main.py[WARNING]: Ran cc_ntp but it failed!

@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Ryan Harper(raharper) wrote on 2020-07-01T20:11:28.980958+00:00

Centos/Rhel/Fedora/SuSE all use chronyd.service.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Ryan Harper(raharper) wrote on 2020-07-02T22:48:33.046732+00:00

It also turns out there's no templates/chrony.conf.centos.tmpl (or ntp); we can reuse the rhel one though.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Brett Holman(holmanb) wrote on 2022-08-19T16:37:03.451004+00:00

This bug is believed to be fixed in cloud-init in version 22.3. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant