systemd-252-59
Resolves: RHEL-114974,RHEL-118215
This commit is contained in:
parent
2169d2c18c
commit
35e0d14f41
99
1267-test-rename-TEST-53-ISSUE-16347-to-TEST-53-TIMER.patch
Normal file
99
1267-test-rename-TEST-53-ISSUE-16347-to-TEST-53-TIMER.patch
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
From 0abac4254115db7d86549b517163a13de9377346 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Frantisek Sumsal <frantisek@sumsal.cz>
|
||||||
|
Date: Tue, 23 Sep 2025 14:28:33 +0200
|
||||||
|
Subject: [PATCH] test: rename TEST-53-ISSUE-16347 to TEST-53-TIMER
|
||||||
|
|
||||||
|
And split the existing test into a separate subtest.
|
||||||
|
|
||||||
|
(cherry picked from commit 953c347fb6f293acbd6da009646bfc071b68ddd7)
|
||||||
|
|
||||||
|
Related: RHEL-118215
|
||||||
|
---
|
||||||
|
.../Makefile | 0
|
||||||
|
.../test.sh | 0
|
||||||
|
test/units/testsuite-53.issue-16347.sh | 27 ++++++++++++++++++
|
||||||
|
test/units/testsuite-53.sh | 28 +++----------------
|
||||||
|
4 files changed, 31 insertions(+), 24 deletions(-)
|
||||||
|
rename test/{TEST-53-ISSUE-16347 => TEST-53-TIMER}/Makefile (100%)
|
||||||
|
rename test/{TEST-53-ISSUE-16347 => TEST-53-TIMER}/test.sh (100%)
|
||||||
|
create mode 100755 test/units/testsuite-53.issue-16347.sh
|
||||||
|
|
||||||
|
diff --git a/test/TEST-53-ISSUE-16347/Makefile b/test/TEST-53-TIMER/Makefile
|
||||||
|
similarity index 100%
|
||||||
|
rename from test/TEST-53-ISSUE-16347/Makefile
|
||||||
|
rename to test/TEST-53-TIMER/Makefile
|
||||||
|
diff --git a/test/TEST-53-ISSUE-16347/test.sh b/test/TEST-53-TIMER/test.sh
|
||||||
|
similarity index 100%
|
||||||
|
rename from test/TEST-53-ISSUE-16347/test.sh
|
||||||
|
rename to test/TEST-53-TIMER/test.sh
|
||||||
|
diff --git a/test/units/testsuite-53.issue-16347.sh b/test/units/testsuite-53.issue-16347.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000000..8b266145cd
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/test/units/testsuite-53.issue-16347.sh
|
||||||
|
@@ -0,0 +1,27 @@
|
||||||
|
+#!/usr/bin/env bash
|
||||||
|
+# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
+set -eux
|
||||||
|
+set -o pipefail
|
||||||
|
+
|
||||||
|
+# Reset host date to current time, 3 days in the past.
|
||||||
|
+date -s "-3 days"
|
||||||
|
+trap 'date -s "+3 days"' EXIT
|
||||||
|
+
|
||||||
|
+# Run a timer for every 15 minutes.
|
||||||
|
+systemd-run --unit test-timer --on-calendar "*:0/15:0" true
|
||||||
|
+
|
||||||
|
+next_elapsed=$(systemctl show test-timer.timer -p NextElapseUSecRealtime --value)
|
||||||
|
+next_elapsed=$(date -d "${next_elapsed}" +%s)
|
||||||
|
+now=$(date +%s)
|
||||||
|
+time_delta=$((next_elapsed - now))
|
||||||
|
+
|
||||||
|
+# Check that the timer will elapse in less than 20 minutes.
|
||||||
|
+if [[ "$time_delta" -lt 0 || "$time_delta" -gt 1200 ]]; then
|
||||||
|
+ echo 'Timer elapse outside of the expected 20 minute window.'
|
||||||
|
+ echo " next_elapsed=${next_elapsed}"
|
||||||
|
+ echo " now=${now}"
|
||||||
|
+ echo " time_delta=${time_delta}"
|
||||||
|
+ echo
|
||||||
|
+
|
||||||
|
+ exit 1
|
||||||
|
+fi
|
||||||
|
diff --git a/test/units/testsuite-53.sh b/test/units/testsuite-53.sh
|
||||||
|
index 84cd66129d..9c2a033aa9 100755
|
||||||
|
--- a/test/units/testsuite-53.sh
|
||||||
|
+++ b/test/units/testsuite-53.sh
|
||||||
|
@@ -3,29 +3,9 @@
|
||||||
|
set -eux
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
-: >/failed
|
||||||
|
+# shellcheck source=test/units/test-control.sh
|
||||||
|
+. "$(dirname "$0")"/test-control.sh
|
||||||
|
|
||||||
|
-# Reset host date to current time, 3 days in the past.
|
||||||
|
-date -s "-3 days"
|
||||||
|
+run_subtests
|
||||||
|
|
||||||
|
-# Run a timer for every 15 minutes.
|
||||||
|
-systemd-run --unit test-timer --on-calendar "*:0/15:0" true
|
||||||
|
-
|
||||||
|
-next_elapsed=$(systemctl show test-timer.timer -p NextElapseUSecRealtime --value)
|
||||||
|
-next_elapsed=$(date -d "${next_elapsed}" +%s)
|
||||||
|
-now=$(date +%s)
|
||||||
|
-time_delta=$((next_elapsed - now))
|
||||||
|
-
|
||||||
|
-# Check that the timer will elapse in less than 20 minutes.
|
||||||
|
-((0 < time_delta && time_delta < 1200)) || {
|
||||||
|
- echo 'Timer elapse outside of the expected 20 minute window.'
|
||||||
|
- echo " next_elapsed=${next_elapsed}"
|
||||||
|
- echo " now=${now}"
|
||||||
|
- echo " time_delta=${time_delta}"
|
||||||
|
- echo ''
|
||||||
|
-} >>/failed
|
||||||
|
-
|
||||||
|
-if test ! -s /failed ; then
|
||||||
|
- rm -f /failed
|
||||||
|
- touch /testok
|
||||||
|
-fi
|
||||||
|
+touch /testok
|
||||||
101
1268-test-restarting-elapsed-timer-shouldn-t-trigger-the-.patch
Normal file
101
1268-test-restarting-elapsed-timer-shouldn-t-trigger-the-.patch
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
From 53b158318d6bfbb1e59b91bfad15e7d128622efb Mon Sep 17 00:00:00 2001
|
||||||
|
From: Frantisek Sumsal <frantisek@sumsal.cz>
|
||||||
|
Date: Tue, 23 Sep 2025 17:42:01 +0200
|
||||||
|
Subject: [PATCH] test: restarting elapsed timer shouldn't trigger the
|
||||||
|
corresponding service
|
||||||
|
|
||||||
|
Provides coverage for:
|
||||||
|
- https://github.com/systemd/systemd/issues/31231
|
||||||
|
- https://github.com/systemd/systemd/issues/35805
|
||||||
|
|
||||||
|
(cherry picked from commit 5730a400fd5ee82566fe03eb832121a0d4bc26b6)
|
||||||
|
|
||||||
|
Related: RHEL-118215
|
||||||
|
---
|
||||||
|
test/units/testsuite-53.restart-trigger.sh | 77 ++++++++++++++++++++++
|
||||||
|
1 file changed, 77 insertions(+)
|
||||||
|
create mode 100755 test/units/testsuite-53.restart-trigger.sh
|
||||||
|
|
||||||
|
diff --git a/test/units/testsuite-53.restart-trigger.sh b/test/units/testsuite-53.restart-trigger.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000000..057f379ddc
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/test/units/testsuite-53.restart-trigger.sh
|
||||||
|
@@ -0,0 +1,77 @@
|
||||||
|
+#!/usr/bin/env bash
|
||||||
|
+# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
+#
|
||||||
|
+# Restarting an already elapsed timer shouldn't immediately trigger the corresponding service unit.
|
||||||
|
+#
|
||||||
|
+# Provides coverage for:
|
||||||
|
+# - https://github.com/systemd/systemd/issues/31231
|
||||||
|
+# - https://github.com/systemd/systemd/issues/35805
|
||||||
|
+set -eux
|
||||||
|
+set -o pipefail
|
||||||
|
+
|
||||||
|
+# shellcheck source=test/units/test-control.sh
|
||||||
|
+. "$(dirname "$0")"/util.sh
|
||||||
|
+
|
||||||
|
+UNIT_NAME="timer-restart-$RANDOM"
|
||||||
|
+TEST_MESSAGE="Hello from timer $RANDOM"
|
||||||
|
+
|
||||||
|
+# Setup
|
||||||
|
+cat >"/run/systemd/system/$UNIT_NAME.timer" <<EOF
|
||||||
|
+[Timer]
|
||||||
|
+OnCalendar=$(date --date="+1 hour" "+%Y-%m-%d %H:%M:%S")
|
||||||
|
+AccuracySec=1s
|
||||||
|
+EOF
|
||||||
|
+
|
||||||
|
+cat >"/run/systemd/system/$UNIT_NAME.service" <<EOF
|
||||||
|
+[Service]
|
||||||
|
+ExecStart=echo "$TEST_MESSAGE"
|
||||||
|
+EOF
|
||||||
|
+
|
||||||
|
+systemctl daemon-reload
|
||||||
|
+
|
||||||
|
+JOURNAL_TS="$(date "+%s")"
|
||||||
|
+# Paranoia check that the test message is not already in the logs
|
||||||
|
+(! journalctl -p info --since="@$JOURNAL_TS" --unit="$UNIT_NAME" --grep="$TEST_MESSAGE")
|
||||||
|
+
|
||||||
|
+# Restart time timer and move time forward by 2 hours to trigger the timer
|
||||||
|
+systemctl restart "$UNIT_NAME.timer"
|
||||||
|
+systemctl status "$UNIT_NAME.timer"
|
||||||
|
+
|
||||||
|
+date -s '+2 hours'
|
||||||
|
+trap 'date -s "-2 hours"' EXIT
|
||||||
|
+sleep 1
|
||||||
|
+systemctl status "$UNIT_NAME.timer"
|
||||||
|
+assert_eq "$(journalctl -q -p info --since="@$JOURNAL_TS" --unit="$UNIT_NAME" --grep="$TEST_MESSAGE" | wc -l)" "1"
|
||||||
|
+
|
||||||
|
+# Restarting the timer unit shouldn't trigger neither the timer nor the service, so these
|
||||||
|
+# fields should remain constant through the following tests
|
||||||
|
+SERVICE_INV_ID="$(systemctl show --property=InvocationID "$UNIT_NAME.service")"
|
||||||
|
+TIMER_LAST_TRIGGER="$(systemctl show --property=LastTriggerUSec "$UNIT_NAME.timer")"
|
||||||
|
+
|
||||||
|
+# Now restart the timer and check if the timer and the service weren't triggered again
|
||||||
|
+systemctl restart "$UNIT_NAME.timer"
|
||||||
|
+sleep 5
|
||||||
|
+assert_eq "$(journalctl -q -p info --since="@$JOURNAL_TS" --unit="$UNIT_NAME" --grep="$TEST_MESSAGE" | wc -l)" "1"
|
||||||
|
+assert_eq "$SERVICE_INV_ID" "$(systemctl show --property=InvocationID "$UNIT_NAME.service")"
|
||||||
|
+assert_eq "$TIMER_LAST_TRIGGER" "$(systemctl show --property=LastTriggerUSec "$UNIT_NAME.timer")"
|
||||||
|
+
|
||||||
|
+# Set the timer into the past, restart it, and again check if it wasn't triggered
|
||||||
|
+TIMER_TS="$(date --date="-1 day" "+%Y-%m-%d %H:%M:%S")"
|
||||||
|
+mkdir "/run/systemd/system/$UNIT_NAME.timer.d/"
|
||||||
|
+cat >"/run/systemd/system/$UNIT_NAME.timer.d/99-override.conf" <<EOF
|
||||||
|
+[Timer]
|
||||||
|
+OnCalendar=$TIMER_TS
|
||||||
|
+EOF
|
||||||
|
+systemctl daemon-reload
|
||||||
|
+systemctl status "$UNIT_NAME.timer"
|
||||||
|
+assert_in "OnCalendar=$TIMER_TS" "$(systemctl show -P TimersCalendar "$UNIT_NAME".timer)"
|
||||||
|
+systemctl restart "$UNIT_NAME.timer"
|
||||||
|
+sleep 5
|
||||||
|
+assert_eq "$(journalctl -q -p info --since="@$JOURNAL_TS" --unit="$UNIT_NAME" --grep="$TEST_MESSAGE" | wc -l)" "1"
|
||||||
|
+assert_eq "$SERVICE_INV_ID" "$(systemctl show --property=InvocationID "$UNIT_NAME.service")"
|
||||||
|
+assert_eq "$TIMER_LAST_TRIGGER" "$(systemctl show --property=LastTriggerUSec "$UNIT_NAME.timer")"
|
||||||
|
+
|
||||||
|
+# Cleanup
|
||||||
|
+systemctl stop "$UNIT_NAME".{timer,service}
|
||||||
|
+rm -f "/run/systemd/system/$UNIT_NAME".{timer,service}
|
||||||
|
+systemctl daemon-reload
|
||||||
156
1269-test-check-the-next-elapse-timer-timestamp-after-des.patch
Normal file
156
1269-test-check-the-next-elapse-timer-timestamp-after-des.patch
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
From 14aa00df0638e8011dd7360eb58d3b0ac64a818a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Frantisek Sumsal <frantisek@sumsal.cz>
|
||||||
|
Date: Tue, 23 Sep 2025 21:04:12 +0200
|
||||||
|
Subject: [PATCH] test: check the next elapse timer timestamp after
|
||||||
|
deserialization
|
||||||
|
|
||||||
|
When deserializing a serialized timer unit with RandomizedDelaySec= set,
|
||||||
|
systemd should use the last inactive exit timestamp instead of current
|
||||||
|
realtime to calculate the new next elapse, so the timer unit actually
|
||||||
|
runs in the given calendar window.
|
||||||
|
|
||||||
|
Provides coverage for:
|
||||||
|
- https://github.com/systemd/systemd/issues/18678
|
||||||
|
- https://github.com/systemd/systemd/pull/27752
|
||||||
|
|
||||||
|
(cherry picked from commit f4c3c107d9be4e922a080fc292ed3889c4e0f4a5)
|
||||||
|
|
||||||
|
Related: RHEL-118215
|
||||||
|
---
|
||||||
|
.../testsuite-53.RandomizedDelaySec-reload.sh | 97 +++++++++++++++++++
|
||||||
|
test/units/util.sh | 18 ++++
|
||||||
|
2 files changed, 115 insertions(+)
|
||||||
|
create mode 100755 test/units/testsuite-53.RandomizedDelaySec-reload.sh
|
||||||
|
|
||||||
|
diff --git a/test/units/testsuite-53.RandomizedDelaySec-reload.sh b/test/units/testsuite-53.RandomizedDelaySec-reload.sh
|
||||||
|
new file mode 100755
|
||||||
|
index 0000000000..08f4f469d6
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/test/units/testsuite-53.RandomizedDelaySec-reload.sh
|
||||||
|
@@ -0,0 +1,97 @@
|
||||||
|
+#!/usr/bin/env bash
|
||||||
|
+# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
+#
|
||||||
|
+# When deserializing a serialized timer unit with RandomizedDelaySec= set, systemd should use the last
|
||||||
|
+# inactive exit timestamp instead of current realtime to calculate the new next elapse, so the timer unit
|
||||||
|
+# actually runs in the given calendar window.
|
||||||
|
+#
|
||||||
|
+# Provides coverage for:
|
||||||
|
+# - https://github.com/systemd/systemd/issues/18678
|
||||||
|
+# - https://github.com/systemd/systemd/pull/27752
|
||||||
|
+set -eux
|
||||||
|
+set -o pipefail
|
||||||
|
+
|
||||||
|
+# shellcheck source=test/units/test-control.sh
|
||||||
|
+. "$(dirname "$0")"/util.sh
|
||||||
|
+
|
||||||
|
+UNIT_NAME="timer-RandomizedDelaySec-$RANDOM"
|
||||||
|
+TARGET_TS="$(date --date="tomorrow 00:10")"
|
||||||
|
+TARGET_TS_S="$(date --date="$TARGET_TS" "+%s")"
|
||||||
|
+# Maximum possible next elapse timestamp: $TARGET_TS (OnCalendar=) + 22 hours (RandomizedDelaySec=)
|
||||||
|
+MAX_NEXT_ELAPSE_REALTIME_S="$((TARGET_TS_S + 22 * 60 * 60))"
|
||||||
|
+MAX_NEXT_ELAPSE_REALTIME="$(date --date="@$MAX_NEXT_ELAPSE_REALTIME_S")"
|
||||||
|
+
|
||||||
|
+# Let's make sure to return the date & time back to the original state once we're done with our time
|
||||||
|
+# shenigans. One way to do this would be to use hwclock, but the RTC in VMs can be unreliable or slow to
|
||||||
|
+# respond, causing unexpected test fails/timeouts.
|
||||||
|
+#
|
||||||
|
+# Instead, let's save the realtime timestamp before we start with the test together with a current monotonic
|
||||||
|
+# timestamp, after the test ends take the difference between the current monotonic timestamp and the "start"
|
||||||
|
+# one, add it to the originally saved realtime timestamp, and finally use that timestamp to set the system
|
||||||
|
+# time. This should advance the system time by the amount of time the test actually ran, and hence restore it
|
||||||
|
+# to some sane state after the time jumps performed by the test. It won't be perfect, but it should be close
|
||||||
|
+# enough for our needs.
|
||||||
|
+START_REALTIME="$(date "+%s")"
|
||||||
|
+START_MONOTONIC="$(cut -d . -f 1 /proc/uptime)"
|
||||||
|
+at_exit() {
|
||||||
|
+ : "Restore the system date to a sane state"
|
||||||
|
+ END_MONOTONIC="$(cut -d . -f 1 /proc/uptime)"
|
||||||
|
+ date --set="@$((START_REALTIME + END_MONOTONIC - START_MONOTONIC))"
|
||||||
|
+}
|
||||||
|
+trap at_exit EXIT
|
||||||
|
+
|
||||||
|
+# Set some predictable time so we can schedule the first timer elapse in a deterministic-ish way
|
||||||
|
+date --set="23:00"
|
||||||
|
+
|
||||||
|
+# Setup
|
||||||
|
+cat >"/run/systemd/system/$UNIT_NAME.timer" <<EOF
|
||||||
|
+[Timer]
|
||||||
|
+# Run this timer daily, ten minutes after midnight
|
||||||
|
+OnCalendar=*-*-* 00:10:00
|
||||||
|
+RandomizedDelaySec=22h
|
||||||
|
+AccuracySec=1ms
|
||||||
|
+EOF
|
||||||
|
+
|
||||||
|
+cat >"/run/systemd/system/$UNIT_NAME.service" <<EOF
|
||||||
|
+[Service]
|
||||||
|
+ExecStart=echo "Hello world"
|
||||||
|
+EOF
|
||||||
|
+
|
||||||
|
+systemctl daemon-reload
|
||||||
|
+
|
||||||
|
+check_elapse_timestamp() {
|
||||||
|
+ systemctl status "$UNIT_NAME.timer"
|
||||||
|
+ systemctl show -p InactiveExitTimestamp "$UNIT_NAME.timer"
|
||||||
|
+
|
||||||
|
+ NEXT_ELAPSE_REALTIME="$(systemctl show -P NextElapseUSecRealtime "$UNIT_NAME.timer")"
|
||||||
|
+ NEXT_ELAPSE_REALTIME_S="$(date --date="$NEXT_ELAPSE_REALTIME" "+%s")"
|
||||||
|
+ : "Next elapse timestamp should be $TARGET_TS <= $NEXT_ELAPSE_REALTIME <= $MAX_NEXT_ELAPSE_REALTIME"
|
||||||
|
+ assert_ge "$NEXT_ELAPSE_REALTIME_S" "$TARGET_TS_S"
|
||||||
|
+ assert_le "$NEXT_ELAPSE_REALTIME_S" "$MAX_NEXT_ELAPSE_REALTIME_S"
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+# Restart the timer unit and check the initial next elapse timestamp
|
||||||
|
+: "Initial next elapse timestamp"
|
||||||
|
+systemctl restart "$UNIT_NAME.timer"
|
||||||
|
+check_elapse_timestamp
|
||||||
|
+
|
||||||
|
+# Bump the system date to 1 minute after the original calendar timer would've expired (without any random
|
||||||
|
+# delay!) - systemd should recalculate the next elapse timestamp with a new randomized delay, but it should
|
||||||
|
+# use the original inactive exit timestamp as a "base", so the final timestamp should not end up beyond the
|
||||||
|
+# original calendar timestamp + randomized delay range.
|
||||||
|
+#
|
||||||
|
+# Similarly, do the same check after doing daemon-reload, as that also forces systemd to recalculate the next
|
||||||
|
+# elapse timestamp (this goes through a slightly different codepath that actually contained the original
|
||||||
|
+# issue).
|
||||||
|
+: "Next elapse timestamp after time jump"
|
||||||
|
+date -s "tomorrow 00:11"
|
||||||
|
+check_elapse_timestamp
|
||||||
|
+
|
||||||
|
+: "Next elapse timestamp after daemon-reload"
|
||||||
|
+systemctl daemon-reload
|
||||||
|
+check_elapse_timestamp
|
||||||
|
+
|
||||||
|
+# Cleanup
|
||||||
|
+systemctl stop "$UNIT_NAME".{timer,service}
|
||||||
|
+rm -f "/run/systemd/system/$UNIT_NAME".{timer,service}
|
||||||
|
+systemctl daemon-reload
|
||||||
|
diff --git a/test/units/util.sh b/test/units/util.sh
|
||||||
|
index 00b8c5e393..5728b324a9 100755
|
||||||
|
--- a/test/units/util.sh
|
||||||
|
+++ b/test/units/util.sh
|
||||||
|
@@ -26,6 +26,24 @@ assert_eq() {(
|
||||||
|
fi
|
||||||
|
)}
|
||||||
|
|
||||||
|
+assert_le() {(
|
||||||
|
+ set +ex
|
||||||
|
+
|
||||||
|
+ if [[ "${1:?}" -gt "${2:?}" ]]; then
|
||||||
|
+ echo "FAIL: '$1' > '$2'" >&2
|
||||||
|
+ exit 1
|
||||||
|
+ fi
|
||||||
|
+)}
|
||||||
|
+
|
||||||
|
+assert_ge() {(
|
||||||
|
+ set +ex
|
||||||
|
+
|
||||||
|
+ if [[ "${1:?}" -lt "${2:?}" ]]; then
|
||||||
|
+ echo "FAIL: '$1' < '$2'" >&2
|
||||||
|
+ exit 1
|
||||||
|
+ fi
|
||||||
|
+)}
|
||||||
|
+
|
||||||
|
assert_in() {(
|
||||||
|
set +ex
|
||||||
|
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
From a5e7446ae2442558f9c13d814e778f13a7018e23 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lukas Nykryn <lnykryn@redhat.com>
|
||||||
|
Date: Tue, 9 Sep 2025 15:24:22 +0200
|
||||||
|
Subject: [PATCH] timer: don't run service immediately after restart of a timer
|
||||||
|
|
||||||
|
When a timer is restarted, don't reset the last_trigger field.
|
||||||
|
This prevents the timer from triggering immediately.
|
||||||
|
|
||||||
|
Fixes: #31231
|
||||||
|
(cherry picked from commit 3fc44a0f68412b649e16f12ff2f97a36c615457d)
|
||||||
|
|
||||||
|
Resolves: RHEL-118215
|
||||||
|
---
|
||||||
|
src/core/timer.c | 2 --
|
||||||
|
1 file changed, 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/core/timer.c b/src/core/timer.c
|
||||||
|
index 60e8fea79f..2eadca4f1a 100644
|
||||||
|
--- a/src/core/timer.c
|
||||||
|
+++ b/src/core/timer.c
|
||||||
|
@@ -635,8 +635,6 @@ static int timer_start(Unit *u) {
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
|
- t->last_trigger = DUAL_TIMESTAMP_NULL;
|
||||||
|
-
|
||||||
|
/* Reenable all timers that depend on unit activation time */
|
||||||
|
LIST_FOREACH(value, v, t->values)
|
||||||
|
if (v->base == TIMER_ACTIVE)
|
||||||
49
1271-test-store-and-compare-just-the-property-value.patch
Normal file
49
1271-test-store-and-compare-just-the-property-value.patch
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
From c603c6cb569f0900ddf07f0311ffa038a242fac8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Frantisek Sumsal <frantisek@sumsal.cz>
|
||||||
|
Date: Mon, 29 Sep 2025 16:11:27 +0200
|
||||||
|
Subject: [PATCH] test: store and compare just the property value
|
||||||
|
|
||||||
|
Follow-up for 5730a400fd5ee82566fe03eb832121a0d4bc26b6.
|
||||||
|
|
||||||
|
(cherry picked from commit 0cb252d50f35256bff569fa6213784f2d45ad6a1)
|
||||||
|
|
||||||
|
Related: RHEL-118215
|
||||||
|
---
|
||||||
|
test/units/testsuite-53.restart-trigger.sh | 12 ++++++------
|
||||||
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/test/units/testsuite-53.restart-trigger.sh b/test/units/testsuite-53.restart-trigger.sh
|
||||||
|
index 057f379ddc..e5cd575d66 100755
|
||||||
|
--- a/test/units/testsuite-53.restart-trigger.sh
|
||||||
|
+++ b/test/units/testsuite-53.restart-trigger.sh
|
||||||
|
@@ -45,15 +45,15 @@ assert_eq "$(journalctl -q -p info --since="@$JOURNAL_TS" --unit="$UNIT_NAME" --
|
||||||
|
|
||||||
|
# Restarting the timer unit shouldn't trigger neither the timer nor the service, so these
|
||||||
|
# fields should remain constant through the following tests
|
||||||
|
-SERVICE_INV_ID="$(systemctl show --property=InvocationID "$UNIT_NAME.service")"
|
||||||
|
-TIMER_LAST_TRIGGER="$(systemctl show --property=LastTriggerUSec "$UNIT_NAME.timer")"
|
||||||
|
+SERVICE_INV_ID="$(systemctl show -P InvocationID "$UNIT_NAME.service")"
|
||||||
|
+TIMER_LAST_TRIGGER="$(systemctl show -P LastTriggerUSec "$UNIT_NAME.timer")"
|
||||||
|
|
||||||
|
# Now restart the timer and check if the timer and the service weren't triggered again
|
||||||
|
systemctl restart "$UNIT_NAME.timer"
|
||||||
|
sleep 5
|
||||||
|
assert_eq "$(journalctl -q -p info --since="@$JOURNAL_TS" --unit="$UNIT_NAME" --grep="$TEST_MESSAGE" | wc -l)" "1"
|
||||||
|
-assert_eq "$SERVICE_INV_ID" "$(systemctl show --property=InvocationID "$UNIT_NAME.service")"
|
||||||
|
-assert_eq "$TIMER_LAST_TRIGGER" "$(systemctl show --property=LastTriggerUSec "$UNIT_NAME.timer")"
|
||||||
|
+assert_eq "$SERVICE_INV_ID" "$(systemctl show -P InvocationID "$UNIT_NAME.service")"
|
||||||
|
+assert_eq "$TIMER_LAST_TRIGGER" "$(systemctl show -P LastTriggerUSec "$UNIT_NAME.timer")"
|
||||||
|
|
||||||
|
# Set the timer into the past, restart it, and again check if it wasn't triggered
|
||||||
|
TIMER_TS="$(date --date="-1 day" "+%Y-%m-%d %H:%M:%S")"
|
||||||
|
@@ -68,8 +68,8 @@ assert_in "OnCalendar=$TIMER_TS" "$(systemctl show -P TimersCalendar "$UNIT_NAME
|
||||||
|
systemctl restart "$UNIT_NAME.timer"
|
||||||
|
sleep 5
|
||||||
|
assert_eq "$(journalctl -q -p info --since="@$JOURNAL_TS" --unit="$UNIT_NAME" --grep="$TEST_MESSAGE" | wc -l)" "1"
|
||||||
|
-assert_eq "$SERVICE_INV_ID" "$(systemctl show --property=InvocationID "$UNIT_NAME.service")"
|
||||||
|
-assert_eq "$TIMER_LAST_TRIGGER" "$(systemctl show --property=LastTriggerUSec "$UNIT_NAME.timer")"
|
||||||
|
+assert_eq "$SERVICE_INV_ID" "$(systemctl show -P InvocationID "$UNIT_NAME.service")"
|
||||||
|
+assert_eq "$TIMER_LAST_TRIGGER" "$(systemctl show -P LastTriggerUSec "$UNIT_NAME.timer")"
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
systemctl stop "$UNIT_NAME".{timer,service}
|
||||||
@ -0,0 +1,94 @@
|
|||||||
|
From d4299294d40b7fe713d0c9df0f7a42c70654e886 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Frantisek Sumsal <frantisek@sumsal.cz>
|
||||||
|
Date: Fri, 5 Apr 2024 12:18:58 +0200
|
||||||
|
Subject: [PATCH] test: make test-fd-util more lenient when using
|
||||||
|
fd_move_above_stdio()
|
||||||
|
|
||||||
|
On s390x this test fails when the SUT uses the z90crypt kernel module,
|
||||||
|
as it's an another FD the test doesn't account for:
|
||||||
|
|
||||||
|
/* test_rearrange_stdio */
|
||||||
|
Successfully forked off 'rearrange' as PID 57293.
|
||||||
|
test_rearrange_stdio: r=0
|
||||||
|
/proc/57293/fd:
|
||||||
|
total 0
|
||||||
|
lrwx------. 1 root root 64 Apr 5 06:18 0 -> /dev/pts/0
|
||||||
|
lrwx------. 1 root root 64 Apr 5 06:18 1 -> /dev/pts/0
|
||||||
|
lrwx------. 1 root root 64 Apr 5 06:18 2 -> /dev/pts/0
|
||||||
|
lrwx------. 1 root root 64 Apr 5 06:18 3 -> /dev/z90crypt
|
||||||
|
rearrange terminated by signal ABRT.
|
||||||
|
|
||||||
|
Debugging this was pain, since the child process didn't log anything
|
||||||
|
once we closed stdout/stderr (for obvious reasons). Let's fix both
|
||||||
|
issues by switching logging to kmsg once we close stdin/stdout/stderr,
|
||||||
|
and also by making the test work fine when there are some extra FDs in
|
||||||
|
the child's environment.
|
||||||
|
|
||||||
|
(cherry picked from commit a9805f8ca9c1561e373355fe7175579b31e1c08c)
|
||||||
|
|
||||||
|
Related: RHEL-114974
|
||||||
|
---
|
||||||
|
src/test/test-fd-util.c | 22 +++++++++++++---------
|
||||||
|
1 file changed, 13 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/test/test-fd-util.c b/src/test/test-fd-util.c
|
||||||
|
index 5b5a712469..5d6c5325a5 100644
|
||||||
|
--- a/src/test/test-fd-util.c
|
||||||
|
+++ b/src/test/test-fd-util.c
|
||||||
|
@@ -127,6 +127,7 @@ TEST(rearrange_stdio) {
|
||||||
|
|
||||||
|
if (r == 0) {
|
||||||
|
_cleanup_free_ char *path = NULL;
|
||||||
|
+ int pipe_read_fd, pair[2];
|
||||||
|
char buffer[10];
|
||||||
|
|
||||||
|
/* Child */
|
||||||
|
@@ -134,6 +135,10 @@ TEST(rearrange_stdio) {
|
||||||
|
safe_close(STDERR_FILENO); /* Let's close an fd < 2, to make it more interesting */
|
||||||
|
|
||||||
|
assert_se(rearrange_stdio(-1, -1, -1) >= 0);
|
||||||
|
+ /* Reconfigure logging after rearranging stdout/stderr, so we still log to somewhere if the
|
||||||
|
+ * following tests fail, making it slightly less annoying to debug */
|
||||||
|
+ log_set_target(LOG_TARGET_KMSG);
|
||||||
|
+ log_open();
|
||||||
|
|
||||||
|
assert_se(fd_get_path(STDIN_FILENO, &path) >= 0);
|
||||||
|
assert_se(path_equal(path, "/dev/null"));
|
||||||
|
@@ -151,13 +156,12 @@ TEST(rearrange_stdio) {
|
||||||
|
safe_close(STDOUT_FILENO);
|
||||||
|
safe_close(STDERR_FILENO);
|
||||||
|
|
||||||
|
- {
|
||||||
|
- int pair[2];
|
||||||
|
- assert_se(pipe(pair) >= 0);
|
||||||
|
- assert_se(pair[0] == 0);
|
||||||
|
- assert_se(pair[1] == 1);
|
||||||
|
- assert_se(fd_move_above_stdio(0) == 3);
|
||||||
|
- }
|
||||||
|
+ assert_se(pipe(pair) >= 0);
|
||||||
|
+ assert_se(pair[0] == 0);
|
||||||
|
+ assert_se(pair[1] == 1);
|
||||||
|
+ pipe_read_fd = fd_move_above_stdio(0);
|
||||||
|
+ assert_se(pipe_read_fd >= 3);
|
||||||
|
+
|
||||||
|
assert_se(open("/dev/full", O_WRONLY|O_CLOEXEC) == 0);
|
||||||
|
assert_se(acquire_data_fd("foobar", 6, 0) == 2);
|
||||||
|
|
||||||
|
@@ -165,7 +169,7 @@ TEST(rearrange_stdio) {
|
||||||
|
|
||||||
|
assert_se(write(1, "x", 1) < 0 && errno == ENOSPC);
|
||||||
|
assert_se(write(2, "z", 1) == 1);
|
||||||
|
- assert_se(read(3, buffer, sizeof(buffer)) == 1);
|
||||||
|
+ assert_se(read(pipe_read_fd, buffer, sizeof(buffer)) == 1);
|
||||||
|
assert_se(buffer[0] == 'z');
|
||||||
|
assert_se(read(0, buffer, sizeof(buffer)) == 6);
|
||||||
|
assert_se(memcmp(buffer, "foobar", 6) == 0);
|
||||||
|
@@ -173,7 +177,7 @@ TEST(rearrange_stdio) {
|
||||||
|
assert_se(rearrange_stdio(-1, 1, 2) >= 0);
|
||||||
|
assert_se(write(1, "a", 1) < 0 && errno == ENOSPC);
|
||||||
|
assert_se(write(2, "y", 1) == 1);
|
||||||
|
- assert_se(read(3, buffer, sizeof(buffer)) == 1);
|
||||||
|
+ assert_se(read(pipe_read_fd, buffer, sizeof(buffer)) == 1);
|
||||||
|
assert_se(buffer[0] == 'y');
|
||||||
|
|
||||||
|
assert_se(fd_get_path(0, &path) >= 0);
|
||||||
51
1273-basic-add-PIDFS-magic-31709.patch
Normal file
51
1273-basic-add-PIDFS-magic-31709.patch
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
From 2c74cdb28bad7e8122bfd51a6d4897f792ef3e2f Mon Sep 17 00:00:00 2001
|
||||||
|
From: cpackham-atlnz <85916201+cpackham-atlnz@users.noreply.github.com>
|
||||||
|
Date: Tue, 12 Mar 2024 00:55:36 +1300
|
||||||
|
Subject: [PATCH] basic: add PIDFS magic (#31709)
|
||||||
|
|
||||||
|
Kernel commit cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b added pidfs.
|
||||||
|
Update filesystems-gperf.gperf and missing_magic.h accordingly.
|
||||||
|
|
||||||
|
This fixes the following error building against a bleeding edge kernel.
|
||||||
|
```
|
||||||
|
../src/basic/meson.build:234:8: ERROR: Problem encountered: Unknown filesystems defined in kernel headers:
|
||||||
|
|
||||||
|
Filesystem found in kernel header but not in filesystems-gperf.gperf: PID_FS_MAGIC
|
||||||
|
```
|
||||||
|
|
||||||
|
(cherry picked from commit ed01b92e1c92871bbd92711f280e2b2d15753f0e)
|
||||||
|
|
||||||
|
Resolves: RHEL-114974
|
||||||
|
---
|
||||||
|
src/basic/filesystems-gperf.gperf | 1 +
|
||||||
|
src/basic/missing_magic.h | 5 +++++
|
||||||
|
2 files changed, 6 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/basic/filesystems-gperf.gperf b/src/basic/filesystems-gperf.gperf
|
||||||
|
index e8c5357f91..1cd66b5a5f 100644
|
||||||
|
--- a/src/basic/filesystems-gperf.gperf
|
||||||
|
+++ b/src/basic/filesystems-gperf.gperf
|
||||||
|
@@ -91,6 +91,7 @@ ocfs2, {OCFS2_SUPER_MAGIC}
|
||||||
|
openpromfs, {OPENPROM_SUPER_MAGIC}
|
||||||
|
orangefs, {ORANGEFS_DEVREQ_MAGIC}
|
||||||
|
overlay, {OVERLAYFS_SUPER_MAGIC}
|
||||||
|
+pidfs, {PID_FS_MAGIC}
|
||||||
|
pipefs, {PIPEFS_MAGIC}
|
||||||
|
ppc-cmm, {PPC_CMM_MAGIC}
|
||||||
|
proc, {PROC_SUPER_MAGIC}
|
||||||
|
diff --git a/src/basic/missing_magic.h b/src/basic/missing_magic.h
|
||||||
|
index c104fcfba3..82ede1873e 100644
|
||||||
|
--- a/src/basic/missing_magic.h
|
||||||
|
+++ b/src/basic/missing_magic.h
|
||||||
|
@@ -128,6 +128,11 @@
|
||||||
|
#define DEVMEM_MAGIC 0x454d444d
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+/* cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b (6.8) */
|
||||||
|
+#ifndef PID_FS_MAGIC
|
||||||
|
+#define PID_FS_MAGIC 0x50494446
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/* Not in mainline but included in Ubuntu */
|
||||||
|
#ifndef SHIFTFS_MAGIC
|
||||||
|
#define SHIFTFS_MAGIC 0x6a656a62
|
||||||
18
systemd.spec
18
systemd.spec
@ -21,7 +21,7 @@
|
|||||||
Name: systemd
|
Name: systemd
|
||||||
Url: https://systemd.io
|
Url: https://systemd.io
|
||||||
Version: 252
|
Version: 252
|
||||||
Release: 57%{?dist}
|
Release: 59%{?dist}
|
||||||
# For a breakdown of the licensing, see README
|
# For a breakdown of the licensing, see README
|
||||||
License: LGPLv2+ and MIT and GPLv2+
|
License: LGPLv2+ and MIT and GPLv2+
|
||||||
Summary: System and Service Manager
|
Summary: System and Service Manager
|
||||||
@ -1349,6 +1349,13 @@ Patch1263: 1263-Revert-Revert-udev-builtin-net_id-use-firmware_node-.patch
|
|||||||
Patch1264: 1264-udev-builtin-net_id-ignore-firmware_node-sun-0.patch
|
Patch1264: 1264-udev-builtin-net_id-ignore-firmware_node-sun-0.patch
|
||||||
Patch1265: 1265-fundamental-fix-compile-check-for-explicit_bzero.patch
|
Patch1265: 1265-fundamental-fix-compile-check-for-explicit_bzero.patch
|
||||||
Patch1266: 1266-time-util-make-USEC_TIMESTAMP_FORMATTABLE_MAX-for-32.patch
|
Patch1266: 1266-time-util-make-USEC_TIMESTAMP_FORMATTABLE_MAX-for-32.patch
|
||||||
|
Patch1267: 1267-test-rename-TEST-53-ISSUE-16347-to-TEST-53-TIMER.patch
|
||||||
|
Patch1268: 1268-test-restarting-elapsed-timer-shouldn-t-trigger-the-.patch
|
||||||
|
Patch1269: 1269-test-check-the-next-elapse-timer-timestamp-after-des.patch
|
||||||
|
Patch1270: 1270-timer-don-t-run-service-immediately-after-restart-of.patch
|
||||||
|
Patch1271: 1271-test-store-and-compare-just-the-property-value.patch
|
||||||
|
Patch1272: 1272-test-make-test-fd-util-more-lenient-when-using-fd_mo.patch
|
||||||
|
Patch1273: 1273-basic-add-PIDFS-magic-31709.patch
|
||||||
|
|
||||||
# Downstream-only patches (9000–9999)
|
# Downstream-only patches (9000–9999)
|
||||||
|
|
||||||
@ -2226,6 +2233,15 @@ systemd-hwdb update &>/dev/null || :
|
|||||||
%{_prefix}/lib/dracut/modules.d/70rhel-net-naming-sysattrs/*
|
%{_prefix}/lib/dracut/modules.d/70rhel-net-naming-sysattrs/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Oct 02 2025 systemd maintenance team <systemd-maint@redhat.com> - 252-59
|
||||||
|
- test: rename TEST-53-ISSUE-16347 to TEST-53-TIMER (RHEL-118215)
|
||||||
|
- test: restarting elapsed timer shouldn't trigger the corresponding service (RHEL-118215)
|
||||||
|
- test: check the next elapse timer timestamp after deserialization (RHEL-118215)
|
||||||
|
- timer: don't run service immediately after restart of a timer (RHEL-118215)
|
||||||
|
- test: store and compare just the property value (RHEL-118215)
|
||||||
|
- test: make test-fd-util more lenient when using fd_move_above_stdio() (RHEL-114974)
|
||||||
|
- basic: add PIDFS magic (#31709) (RHEL-114974)
|
||||||
|
|
||||||
* Tue Sep 16 2025 systemd maintenance team <systemd-maint@redhat.com> - 252-57
|
* Tue Sep 16 2025 systemd maintenance team <systemd-maint@redhat.com> - 252-57
|
||||||
- Revert "boot: Use EFI_BOOT_MANAGER_POLICY_PROTOCOL to connect console devices" (RHEL-108596)
|
- Revert "boot: Use EFI_BOOT_MANAGER_POLICY_PROTOCOL to connect console devices" (RHEL-108596)
|
||||||
- boot: Use correct memory type for allocations (RHEL-108555)
|
- boot: Use correct memory type for allocations (RHEL-108555)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user