Skip to content

common/postprocess: compat symlinks for issues.d#215

Open
jbtrystram wants to merge 1 commit into
coreos:mainfrom
jbtrystram:symlink-issue-rhel9
Open

common/postprocess: compat symlinks for issues.d#215
jbtrystram wants to merge 1 commit into
coreos:mainfrom
jbtrystram:symlink-issue-rhel9

Conversation

@jbtrystram
Copy link
Copy Markdown
Member

Symlink ignition issues to /etc/issues.d
Since util-linux 2.41 agetty will source issues from /run so we moved FCOS to write the generated issues there in [1].

Until we have util-linux >= 2.41 we need to symlink these back to /etc/issue.d/.

[1] coreos/fedora-coreos-config#4046

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 24, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jbtrystram

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jbtrystram
Copy link
Copy Markdown
Member Author

/hold

this needs the FCOS PR to merge first

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a postprocess step to common.yaml to ensure compatibility for agetty sourcing ignition issue files. It conditionally creates symlinks from /run/issue.d/ to /etc/issue.d/ if the util-linux version is below 2.41. Feedback suggests improving the robustness of the version comparison by removing a newline from the rpm query output and enhancing the symlink creation logic to prevent dangling symlinks when no matching files are found, possibly by using find.

Comment thread common.yaml
- |
#!/usr/bin/env bash
# set -x
installed_ver=$(rpm -q util-linux --qf "%{VERSION}\n")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The \n in the rpm query format will be included in the installed_ver variable. This can lead to unexpected behavior in string comparisons and makes the script more fragile. Please remove it to ensure the version string is clean.

    installed_ver=$(rpm -q util-linux --qf "%{VERSION}")

Comment thread common.yaml Outdated
# Create symlinks from /etc pointing to /run/issue.d/ so agetty picks them up.
# See https://github.com/coreos/fedora-coreos-tracker/issues/2108
[Service]
ExecStartPost=/usr/bin/bash -c "mkdir -p /etc/issue.d && ln -sf /run/issue.d/30_coreos_ignition_*.issue /etc/issue.d/"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The glob pattern 30_coreos_ignition_*.issue might not match any files if ignition does not report any issues. In that case, the shell will pass the literal string to ln, creating a dangling symlink named 30_coreos_ignition_*.issue. To handle this case robustly, it's better to use find to locate the files before attempting to create symlinks. This ensures that ln is only called if files are actually found.

      ExecStartPost=/usr/bin/bash -c "mkdir -p /etc/issue.d && find /run/issue.d -maxdepth 1 -name '30_coreos_ignition_*.issue' -exec ln -sft /etc/issue.d/ {} +"

@jbtrystram jbtrystram force-pushed the symlink-issue-rhel9 branch 4 times, most recently from 778bcb2 to 802865a Compare March 24, 2026 16:54
Symlink ignition issues to /etc/issues.d
Since util-linux 2.41 agetty will source issues from /run so we moved
FCOS to write the generated issues there in [1].

Until we have util-linux >= 2.41 we need to symlink these back
to /etc/issue.d/.

[1] coreos/fedora-coreos-config#4046
@jbtrystram jbtrystram force-pushed the symlink-issue-rhel9 branch from 802865a to 27221d0 Compare March 25, 2026 09:57
Comment thread common.yaml
# Create symlinks from /etc pointing to /run/issue.d/ so agetty picks them up.
# See https://github.com/coreos/fedora-coreos-tracker/issues/2108
[Service]
ExecStartPost=/usr/bin/bash -c "mkdir -p /etc/issue.d && find /run/issue.d -maxdepth 1 -name '30_coreos_ignition_*.issue' -exec ln -sft /etc/issue.d/ {} +"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ExecStartPost=/usr/bin/bash -c "mkdir -p /etc/issue.d && find /run/issue.d -maxdepth 1 -name '30_coreos_ignition_*.issue' -exec ln -sft /etc/issue.d/ {} +"
ExecStartPost=/usr/bin/bash -c "mkdir -p /etc/issue.d && find /run/issue.d -maxdepth 1 -name '30_*ignition_*.issue' -exec ln -sft /etc/issue.d/ {} +"

There is a proposed slight renaming of these config files in https://github.com/PeaceRebel/ignition/pull/7/changes#r3112171987

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads-up ! This whole thing is blocked on a fedora-selinux update that I need to look into, but still haven't got around to it

Comment thread common.yaml
# Util-linux won't source issue files from /run/issue.d/ until v2.41.
# Create symlinks from /etc pointing to /run/issue.d/ so agetty picks them up.
# See https://github.com/coreos/fedora-coreos-tracker/issues/2108
[Service]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there should be a cleanup that happens here too.

i.e. if there are stale /etc/issues.d/30_*ignition_*.issue files should we delete them?

I guess the answer maybe depends on what happens if a broken symlink exists here. If it's non fatal and also not ugly (meaning we don't get a warning about it) then leaving them in place should be fine. Otherwise we should consider cleaning them up.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we were including a systemd-tmpfile that was doing just that in CLHM : https://github.com/coreos/console-login-helper-messages/blob/70344cce1758730245cb46ca4d5bcdb56ff2f20e/usr/lib/tmpfiles.d/console-login-helper-messages-issuegen.conf

We could have the same thing here:

r /etc/issue.d/30_*ignition_*.issue - - - - -

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 12, 2026

@jbtrystram: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/scos-10-build-test-qemu 27221d0 link true /test scos-10-build-test-qemu
ci/prow/scos-10-build-test 27221d0 link true /test scos-10-build-test

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants