Commit Graph

14 Commits

Author SHA1 Message Date
Mike Yuan
7eaf5ded61 async: block SIGTERM in asynchronous_rm_rf()
See justifications at https://github.com/systemd/systemd/pull/32235#issuecomment-2062327783
2024-11-14 12:21:25 +00:00
Lennart Poettering
13b5225d62 shutdown: teach sync_with_progress() to optionally sync a specific fd only
This is preparation for reusing the logic for syncing DM and other
devices with a timeout applied.
2024-09-09 19:12:31 +02:00
Mike Yuan
3760416ee8 shared/async: use safe_close where appropriate 2023-12-28 18:26:52 +08:00
Yu Watanabe
627cdcc785 tree-wide: fix typos reported by Fossies Codespell report 2023-07-12 10:14:50 +09:00
Mike Yuan
898f4da326 shared/async: don't use WEXITED for waitpid()
Follow-up for c26d7837bb

waitpid() doesn't support WEXITED and returns -1 (EINVAL),
which results in the intermediate close process not getting
reaped.

Fixes https://github.com/systemd/systemd/issues/26744#issuecomment-1628240782
2023-07-11 12:08:09 +08:00
Mike Yuan
f7b1d37c77 shared/async: prefix process name with sd- 2023-07-11 12:08:09 +08:00
Lennart Poettering
530f6ada2e async: use FORK_DETACH for asynchronous syncs
To get proper "fire-and-forget" feeling we really want to make sure
noone has to reap the forked off process.
2023-06-23 10:05:16 +02:00
Lennart Poettering
78b680f99b async: drop the now unused asynchronous_job() 2023-06-23 10:05:16 +02:00
Lennart Poettering
437f3e35b4 async: add generic implementation of asynchronous_rm_rf()
This one doesn't use threads anymore. This is the last use of threads in
PID 1. Yay!

Fixes: #27287
2023-06-23 10:05:16 +02:00
Lennart Poettering
7e14a308cf shared: move async.[ch] from src/basic/ → src/shared/
That way we can later add an async wrapper for rm_rf() which is in
src/shared/, too.
2023-06-23 10:02:15 +02:00
Kay Sievers
a095315b3c build-sys: split internal basic/ library from shared/
basic/      can be used by everything
            cannot use anything outside of basic/

libsystemd/ can use basic/
            cannot use shared/

shared/     can use libsystemd/
2015-06-11 10:52:46 +02:00
Zbigniew Jędrzejewski-Szmek
c1d630d5fd shared/async: simplify asynchronous_job a bit 2015-02-02 20:31:18 -05:00
Lennart Poettering
5ed1227238 util: make asynchronous_close() really work like an asynchronous version of safe_close()
Save/restore errno, like we do in safe_close(). And don't fork a thread
if the parameter is already negative.
2014-08-21 17:24:21 +02:00
Lennart Poettering
76cf10dab7 build-sys: move async.[ch] to src/shared
So that we can use it at multiple places.
2014-05-05 21:19:06 +02:00