From: Mike Yuan Date: Mon, 11 Nov 2024 18:11:38 +0000 (+0100) Subject: async: block SIGTERM in asynchronous_rm_rf() X-Git-Tag: v257-rc2~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7eaf5ded61e6ae25c790dd3e672d3864f5574327;p=thirdparty%2Fsystemd.git async: block SIGTERM in asynchronous_rm_rf() See justifications at https://github.com/systemd/systemd/pull/32235#issuecomment-2062327783 --- diff --git a/src/shared/async.c b/src/shared/async.c index bd043c8484a..e0c7e7dcaab 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);