Bug 2091217

Summary: cloud-init has an undeclared dependency on the initscripts rpm
Product: Red Hat Enterprise Linux 9 Reporter: Anish Bhatt <anish.7>
Component: cloud-initAssignee: Emanuele Giuseppe Esposito <eesposit>
Status: CLOSED CURRENTRELEASE QA Contact: xiachen
Severity: low Docs Contact:
Priority: high    
Version: CentOS StreamCC: bstinson, eesposit, eterrell, huzhao, jgreguske, jwboyer, xiliang, yacao
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2091841 2091935 (view as bug list) Environment:
Last Closed: 2022-06-02 08:11:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2091841, 2091935    

Description Anish Bhatt 2022-05-27 21:53:23 UTC
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:

Comment 1 xiachen 2022-05-31 04:13:33 UTC
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?

Comment 3 xiachen 2022-05-31 04:21:02 UTC
@Anish

Thanks for reporting this issue, we will handle it.

Comment 7 Emanuele Giuseppe Esposito 2022-06-02 08:11:28 UTC
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