diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-11-11 19:11:38 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-11-14 13:21:25 +0100 |
commit | 7eaf5ded61e6ae25c790dd3e672d3864f5574327 (patch) | |
tree | 79802d603fa5cca76d2daffce9830e735e7de032 /src/shared | |
parent | network/netdev: follow-ups for reloading .netdev files (#34979) (diff) | |
download | systemd-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.c | 4 |
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); |