summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-11-11 19:11:38 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2024-11-14 13:21:25 +0100
commit7eaf5ded61e6ae25c790dd3e672d3864f5574327 (patch)
tree79802d603fa5cca76d2daffce9830e735e7de032 /src/shared
parentnetwork/netdev: follow-ups for reloading .netdev files (#34979) (diff)
downloadsystemd-7eaf5ded61e6ae25c790dd3e672d3864f5574327.tar.xz
systemd-7eaf5ded61e6ae25c790dd3e672d3864f5574327.zip
async: block SIGTERM in asynchronous_rm_rf()
See justifications at https://github.com/systemd/systemd/pull/32235#issuecomment-2062327783
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/async.c4
1 files changed, 4 insertions, 0 deletions
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);