mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
service: stop/reset watchdog on freeze/thaw
Otherwise the unit will be killed by the watchdog given it's frozen but the clock keeps ticking Fixes https://github.com/systemd/systemd/issues/38517
This commit is contained in:
committed by
Yu Watanabe
parent
5ecd16be68
commit
25178aadb2
@@ -360,6 +360,26 @@ testcase_preserve_state() {
|
||||
echo
|
||||
}
|
||||
|
||||
testcase_watchdog() {
|
||||
local unit="wd.service"
|
||||
|
||||
systemd-run --collect --unit "$unit" --property WatchdogSec=4s --property Type=notify \
|
||||
/bin/bash -c 'systemd-notify --ready; while true; do systemd-notify WATCHDOG=1; sleep 1; done'
|
||||
|
||||
systemctl freeze "$unit"
|
||||
|
||||
check_freezer_state "$unit" "frozen"
|
||||
sleep 6
|
||||
check_freezer_state "$unit" "frozen"
|
||||
|
||||
systemctl thaw "$unit"
|
||||
sleep 6
|
||||
check_freezer_state "$unit" "running"
|
||||
systemctl is-active "$unit"
|
||||
|
||||
systemctl stop "$unit"
|
||||
}
|
||||
|
||||
if [[ -e /sys/fs/cgroup/system.slice/cgroup.freeze ]]; then
|
||||
start_test_service
|
||||
run_testcases
|
||||
|
||||
Reference in New Issue
Block a user