Skip to content

Wrong service name used for chrony when restarting service #3756

@ubuntu-server-builder

Description

@ubuntu-server-builder

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    launchpadMigrated from Launchpad

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions