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

(RHEL-5956) install: don't translate unit instances to paths when reenabling them #306

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jamacku
Copy link
Member

@jamacku jamacku commented Dec 20, 2024

For unit instances install_info_discover() returns path to the template, which then generates confusing errors when passed to do_unit_file_enable():

~# build/systemctl --root=/tmp/systemctl-test.N9ysbz reenable [email protected] Unit name: [email protected]; p: /etc/systemd/system/[email protected] Removed "/tmp/systemctl-test.N9ysbz/etc/systemd/system/services.target.wants/[email protected]". Failed to reenable [email protected], destination unit services.target is a non-template unit.

This can also be seen with a different reproducer using [email protected] and a simple bind mount to / - there's no error this time, but it tries to create a symlink for the default instance (from DefaultInstance=tty1), which is also incorrect:

~# SYSTEMD_LOG_LEVEL=debug systemctl --root /mnt/bindroot/ reenable [email protected] Symlink /mnt/bindroot/etc/systemd/system/getty.target.wants/[email protected] → /usr/lib/systemd/system/[email protected] already exists

Follow-up to: 29a7c59
Resolves upstream issue #24740

(cherry picked from commit fe6e0cf)

Resolves: RHEL-5956

For unit instances install_info_discover() returns path to the template,
which then generates confusing errors when passed to
do_unit_file_enable():

~# build/systemctl --root=/tmp/systemctl-test.N9ysbz reenable [email protected]
Unit name: [email protected]; p: /etc/systemd/system/[email protected]
Removed "/tmp/systemctl-test.N9ysbz/etc/systemd/system/services.target.wants/[email protected]".
Failed to reenable [email protected], destination unit services.target is a non-template unit.

This can also be seen with a different reproducer using [email protected]
and a simple bind mount to / - there's no error this time, but it tries
to create a symlink for the default instance (from DefaultInstance=tty1),
which is also incorrect:

~# SYSTEMD_LOG_LEVEL=debug systemctl --root /mnt/bindroot/ reenable [email protected]
Symlink /mnt/bindroot/etc/systemd/system/getty.target.wants/[email protected] → /usr/lib/systemd/system/[email protected] already exists

Follow-up to: 29a7c59
Resolves upstream issue #24740

(cherry picked from commit fe6e0cf)

Resolves: RHEL-5956
@jamacku jamacku added this to the RHEL-9.6.0 milestone Dec 20, 2024
@jamacku jamacku requested a review from msekletar December 20, 2024 13:00
@github-actions github-actions bot changed the title install: don't translate unit instances to paths when reenabling them (RHEL-5956) install: don't translate unit instances to paths when reenabling them Dec 20, 2024
@github-actions github-actions bot added pr/needs-ci Formerly needs-ci pr/needs-review Formerly needs-review labels Dec 20, 2024
Copy link

github-actions bot commented Dec 20, 2024

Commit validation

Tracker - RHEL-5956

The following commits meet all requirements

commit upstream
c1add4b - install: don't translate unit instances to paths when reenabling them systemd/systemd@fe6e0cf
509f233 - test-systemctl-enable: fix typo systemd/systemd@88cc9cc

Tracker validation

Success

🟢 Tracker RHEL-5956 has set desired product: rhel-9.0.0
🟢 Tracker RHEL-5956 has set desired component: systemd
🟢 Tracker RHEL-5956 has been approved
🟢 Tracker RHEL-5956 has set severity


Pull Request validation

Failed

🔴 Failed or pending checks - ci (centos, 9)[failure] Failed or pending statuses - CentOS CI (CentOS Stream 9 + sanitizers)[failure]
🔴 Review - Missing review from a member (1 required)

Follow-up for fe6e0cf.

(cherry picked from commit 88cc9cc)

Related: RHEL-5956
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/needs-ci Formerly needs-ci pr/needs-review Formerly needs-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants