Skip to content

Commit 2a7c73f

Browse files
committed
overlay/core: write ignition issues to /run
Since util-linux 2.41[1] agetty will source issues from multiples places by default (` /etc`, `/run/` and `/usr/lib`). Systemd also worked around [2] this since v258 which has been in fedora 43 for a while now, so let's always write our issues to `/run`. We add a check for RHEL to preserve the back-compatibility symlink. [1] util-linux/util-linux@508fb0e [2] systemd/systemd@864a5e9 Ref coreos/fedora-coreos-tracker#2108 See coreos/console-login-helper-messages#130
1 parent 31a82c0 commit 2a7c73f

3 files changed

Lines changed: 5 additions & 9 deletions

File tree

overlay.d/05core/usr/libexec/coreos-ignition-write-issues

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ $(cat /proc/sys/kernel/random/boot_id) = "${ignitionBoot}" ]; then
1818
# checking for /run/ostree-live as the live system with persistent storage can run Ignition more than once
1919
if ! test -f /run/ostree-live && jq -e .previousReport.provisioningDate "${IGNITION_RESULT}" &>/dev/null; then
2020
prevdate=$(date --date "$(jq -r .previousReport.provisioningDate "${IGNITION_RESULT}")" +"%Y/%m/%d %H:%M:%S %Z")
21-
cat << EOF > /etc/issue.d/30_coreos_ignition_run_more_than_once.issue
21+
cat << EOF > /run/issue.d/30_coreos_ignition_run_more_than_once.issue
2222
${WARN}
2323
############################################################################
2424
WARNING: Ignition previously ran on ${prevdate}. Unexpected
@@ -49,7 +49,7 @@ EOF
4949
# TODO: find a way to query journal entries recorded before the
5050
# system switches to real root
5151
journalctl -t ignition -o cat -p warning | sed -r 's/, line [0-9]+ col [0-9]+//g' | sort -u | while read line; do
52-
echo -e "${WARN}Ignition: $line${RESET}" >> /etc/issue.d/30_coreos_ignition_warnings.issue
52+
echo -e "${WARN}Ignition: $line${RESET}" >> /run/issue.d/30_coreos_ignition_warnings.issue
5353
done
5454
else
5555
nreboots=$(($(journalctl --list-boots | wc -l) - 1))
@@ -65,7 +65,3 @@ else
6565
echo -e "${WARN}Ignition: no config provided by user${RESET}" \
6666
>> /run/issue.d/30_coreos_ignition_provisioning.issue
6767
fi
68-
69-
# Our makeshift way of getting /run/issue.d semantics. See:
70-
# https://github.com/coreos/console-login-helper-messages/blob/e06fc88ae8fbcc3a422bc8c686f70c15aebb9d9a/usr/lib/console-login-helper-messages/issue.defs#L8-L17
71-
ln -sf /run/issue.d/30_coreos_ignition_provisioning.issue /etc/issue.d/

overlay.d/15fcos/usr/libexec/coreos-check-ssh-keys

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ main() {
3939
fi
4040

4141
if [ -n "$output" ]; then
42-
echo "$output" > /etc/issue.d/30_ssh_authorized_keys.issue
42+
echo "$output" > /run/issue.d/30_coreos_ignition_ssh_authorized_keys.issue
4343
else
4444
echo -e "${warn}No SSH authorized keys provided by Ignition or Afterburn${nc}" \
45-
> /etc/issue.d/30_ssh_authorized_keys.issue
45+
> /run/issue.d/30_coreos_ignition_ssh_authorized_keys.issue
4646
fi
4747
}
4848

tests/kola/clhm/ignition-warnings/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ WARN='\e\[0;33m' # yellow
1515
RESET='\e\[0m' # reset
1616

1717
warning="${WARN}Ignition: warning at \\$.systemd.units.0.contents: unit \"echo.service\" is enabled, but has no install section so enable does nothing${RESET}"
18-
warningsfile="/etc/issue.d/30_coreos_ignition_warnings.issue"
18+
warningsfile="/run/issue.d/30_coreos_ignition_warnings.issue"
1919

2020
# Check for the motd file
2121
if ! test -f ${warningsfile}; then

0 commit comments

Comments
 (0)