Description of problem: distros/rhel.py has no default value of init_cmd set, as a result it defaults to the global value of "service" instead of sytemctl https://github.com/canonical/cloud-init/blob/5147e8d4764e368ab8ccea7433b02e4ff9d6c901/cloudinit/distros/__init__.py#L78 The 'service' command helper is provided by the initscripts rpm, which is not called out as a dependency. As a result if cloud-init tries to restart any services, it fails out with a backtrace due the missing service command if the initscripts rpm is not installed Version-Release number of selected component (if applicable): cloud-init-21.1-19.el9 How reproducible: Always Steps to Reproduce: 1. Create an image without the initscripts rpm 2. Try to run any module that restarts a service (I used cc_set_passwords for ssh configuration) Actual results: Cloud-init does not succeed Expected results: Cloud-init should succeed always Additional info:
This issue can be reproduced with cloud-init 21.1 and previous versions, and it has been fixed in 22.1 See upstream PR https://github.com/canonical/cloud-init/pull/1074 @Emanuele, @Eduardo how about creating z-stream bugs for RHEL 9.0 and all RHEL 8.* which is <= 8.6?
@Anish Thanks for reporting this issue, we will handle it.
Since the issue cannot be reproduced in rhel 9.1 (upstream patch is already present), I am closing this BZ. Clones will handle all other releases (9.0, 8.6, 8.4, 8.2). Thank you, Emanuele