summaryrefslogtreecommitdiffstats
path: root/src/partition/repart.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-11-02 11:04:36 +0100
committerLennart Poettering <lennart@poettering.net>2023-11-02 14:09:23 +0100
commite9ccae31355b8d4fd7496b0548470c8c977897d8 (patch)
tree13c5f4246df81fa08c396303b14acf15ccdcc2a5 /src/partition/repart.c
parentfd-util: add new FORMAT_PROC_PID_FD_PATH() helper (diff)
downloadsystemd-e9ccae31355b8d4fd7496b0548470c8c977897d8.tar.xz
systemd-e9ccae31355b8d4fd7496b0548470c8c977897d8.zip
process-util: add new FORK_DEATHSIG_SIGKILL flag, rename FORK_DEATHSIG → FORK_DEATHSIG_SIGTERM
Sometimes it makes sense to hard kill a client if we die. Let's hence add a third FORK_DEATHSIG flag for this purpose: FORK_DEATHSIG_SIGKILL. To make things less confusing this also renames FORK_DEATHSIG to FORK_DEATHSIG_SIGTERM to make clear it sends SIGTERM. We already had FORK_DEATHSIG_SIGINT, hence this makes things nicely symmetric. A bunch of users are switched over for FORK_DEATHSIG_SIGKILL where we know it's safe to abort things abruptly. This should make some kernel cases more robust, since we cannot get confused by signal masks or such. While we are at it, also fix a bunch of bugs where we didn't take FORK_DEATHSIG_SIGINT into account in safe_fork()
Diffstat (limited to 'src/partition/repart.c')
-rw-r--r--src/partition/repart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c
index 94c6d8e42c..c99168b08f 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -4673,7 +4673,7 @@ static int partition_populate_filesystem(Context *context, Partition *p, const c
* appear in the host namespace. Hence we fork a child that has its own file system namespace and
* detached mount propagation. */
- r = safe_fork("(sd-copy)", FORK_DEATHSIG|FORK_LOG|FORK_WAIT|FORK_NEW_MOUNTNS|FORK_MOUNTNS_SLAVE, NULL);
+ r = safe_fork("(sd-copy)", FORK_DEATHSIG_SIGTERM|FORK_LOG|FORK_WAIT|FORK_NEW_MOUNTNS|FORK_MOUNTNS_SLAVE, NULL);
if (r < 0)
return r;
if (r == 0) {