From 7eaf5ded61e6ae25c790dd3e672d3864f5574327 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Mon, 11 Nov 2024 19:11:38 +0100 Subject: [PATCH] async: block SIGTERM in asynchronous_rm_rf() See justifications at https://github.com/systemd/systemd/pull/32235#issuecomment-2062327783 --- src/shared/async.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/async.c b/src/shared/async.c index bd043c8484..e0c7e7dcaa 100644 --- a/src/shared/async.c +++ b/src/shared/async.c @@ -147,6 +147,10 @@ int asynchronous_rm_rf(const char *p, RemoveFlags flags) { /* Child */ + /* Let's block SIGTERM here, to grant the operation more time on e.g. final killing spree + * during shutdown. If this gets stalled pid1 would eventually send SIGKILL to us. */ + BLOCK_SIGNALS(SIGTERM); + r = rm_rf(p, flags); if (r < 0) { log_debug_errno(r, "Failed to rm -rf '%s', ignoring: %m", p); -- 2.25.1