diff --git a/Dockerfile b/Dockerfile index cd2a2f5..d3d7a77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,6 +76,7 @@ RUN last_patch=$(awk '/^Patch[0-9]+/ { line = NR } END { print line }' systemd.s echo 'Patch9501: 9501-cgroup-util-accept-cgroup-hierarchy-base-as-option.patch'; \ echo 'Patch9502: 9502-core-move-initialization-of-.slice-and-init.scope-in.patch'; \ echo 'Patch9503: 9503-core-drop-.slice-from-shipped-units.patch'; \ + echo 'Patch9504: 9504-core-skip-restart-when-a-JOB_STOP-job-is-pending.patch'; \ echo ; \ } >>systemd.mod.spec; \ tail -n+$((last_patch + 1)) systemd.spec >>systemd.mod.spec; \ diff --git a/systemd-patches/9504-core-skip-restart-when-a-JOB_STOP-job-is-pending.patch b/systemd-patches/9504-core-skip-restart-when-a-JOB_STOP-job-is-pending.patch new file mode 100644 index 0000000..4205a9b --- /dev/null +++ b/systemd-patches/9504-core-skip-restart-when-a-JOB_STOP-job-is-pending.patch @@ -0,0 +1,30 @@ +From 9b2f19a583b98e47ffa1f2bdf930eced4f537406 Mon Sep 17 00:00:00 2001 +From: Kyle Sessions +Date: Sat, 4 May 2024 00:26:08 +0000 +Subject: [PATCH] core: skip automatic restart when a JOB_STOP job is pending + +--- + src/core/service.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/src/core/service.c b/src/core/service.c +index 15e29be..fa2af05 100644 +--- a/src/core/service.c ++++ b/src/core/service.c +@@ -1622,12 +1622,7 @@ static void service_enter_restart(Service *s) { + + if (UNIT(s)->job && UNIT(s)->job->type == JOB_STOP) { + /* Don't restart things if we are going down anyway */ +- log_unit_info(UNIT(s)->id, "Stop job pending for unit, delaying automatic restart."); +- +- r = service_arm_timer(s, s->restart_usec); +- if (r < 0) +- goto fail; +- ++ log_unit_info(UNIT(s)->id, "Stop job pending for unit, skipping automatic restart."); + return; + } + +-- +2.40.1 +