-
Notifications
You must be signed in to change notification settings - Fork 231
Package, Dependencies and Config Path Updates to Support Azure Linux 4.0 #4399
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
7017e69
e9e766f
2b9dae1
4519db0
d45422f
dd61b0e
8cc5d89
3138cdc
59ade0f
2ba5331
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2068,7 +2068,7 @@ def name_pattern(cls) -> Pattern[str]: | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def __init__(self, node: Any) -> None: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| super().__init__(node) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self._dnf_tool_name: str | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self._dnf_tool_name: str = "dnf" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def _initialize_package_installation(self) -> None: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.set_kill_user_processes() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -2136,9 +2136,15 @@ def _create_local_repo(self, source_tarball: Path) -> None: | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| # the SSH session is reset | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def set_kill_user_processes(self) -> None: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sed = self._node.tools[Sed] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Azure Linux 4.0 moved logind.conf to /usr/lib/systemd/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logind_conf = "/etc/systemd/logind.conf" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if not self._node.shell.exists( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self._node.get_pure_path(logind_conf) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logind_conf = "/usr/lib/systemd/logind.conf" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+2141
to
+2144
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if not self._node.shell.exists( | |
| self._node.get_pure_path(logind_conf) | |
| ): | |
| logind_conf = "/usr/lib/systemd/logind.conf" | |
| shell = self._node.shell | |
| primary_path = self._node.get_pure_path(logind_conf) | |
| if not shell.exists(primary_path): | |
| fallback_logind_conf = "/usr/lib/systemd/logind.conf" | |
| fallback_path = self._node.get_pure_path(fallback_logind_conf) | |
| if shell.exists(fallback_path): | |
| logind_conf = fallback_logind_conf | |
| else: | |
| # Neither primary nor fallback exist; create the primary config file | |
| self._log.debug( | |
| "Neither /etc/systemd/logind.conf nor /usr/lib/systemd/logind.conf " | |
| "exists. Creating /etc/systemd/logind.conf." | |
| ) | |
| self._node.execute( | |
| "mkdir -p /etc/systemd && touch /etc/systemd/logind.conf", | |
| sudo=True, | |
| shell=True, | |
| expected_exit_code=0, | |
| expected_exit_code_failure_message=( | |
| "Failed to create /etc/systemd/logind.conf" | |
| ), | |
| ) |
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Editing the vendor config at /usr/lib/systemd/logind.conf is brittle (package updates may overwrite it) and may not be the correct override location for systemd. Prefer writing the setting to /etc/systemd/logind.conf (create it if missing) or a drop-in under /etc/systemd/logind.conf.d/, and keep /usr/lib untouched.
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_kill_user_processes() always uses sed.append(...) and restarts systemd-logind, so repeated calls will keep appending duplicate KillUserProcesses=no lines and repeatedly restart the service (this is also currently invoked from _initialize_package_installation). Making the change idempotent (e.g., replace existing KillUserProcesses= or check if the setting already exists before editing/restarting) would avoid config bloat and unnecessary service churn.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -33,11 +33,11 @@ def create(cls, node: "Node", *args: Any, **kwargs: Any) -> Tool: | |||||||
| if isinstance(node.os, CBLMariner): | ||||||||
| if node.os.information.release == "2.0": | ||||||||
| return AzlV2Fips(node, args, kwargs) | ||||||||
| if node.os.information.release == "3.0": | ||||||||
| if node.os.information.release in ("3.0", "4.0"): | ||||||||
| return AzlV3Fips(node, args, kwargs) | ||||||||
|
|
||||||||
| raise UnsupportedDistroException( | ||||||||
| os=node.os, message="FIPS tool only supported on CBLMariner 2.0 and 3.0." | ||||||||
| os=node.os, message="FIPS tool only supported on CBLMariner 2.0, 3.0 and 4.0." | ||||||||
|
||||||||
| os=node.os, message="FIPS tool only supported on CBLMariner 2.0, 3.0 and 4.0." | |
| os=node.os, | |
| message="FIPS tool only supported on CBLMariner 2.0, 3.0 and 4.0.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting
_dnf_tool_namedefault to"dnf"can cause CBLMariner to rundnfbefore_initialize_package_installation()has had a chance to detect whether onlytdnfis available. SinceRPMDistro._install_packages/_uninstall_packagescall_dnf_tool()without first calling_initialize_package_installation(), consider ensuring tool selection is initialized before any package operation (e.g., lazy-init inside_dnf_tool()or overriding_install_packages/_uninstall_packagesto gate on_first_time_installation).