1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-27 01:57:35 +03:00

shared/killall: correctly warn about rootfs daemon's root

Follow-up for 9e615117dab5ede72eec22bf6369e0138f9dace5

We'll typically send signals to all remaining processes in the following
cases:

1. pid1 (in initrd) when transitioning from initrd to sysroot: SIGTERM
2. pid1 (in sysroot) before transitioning back to initrd (exitrd): SIGTERM + SIGKILL
3. systemd-shutdown (in exitrd): SIGTERM + SIGKILL

'warn_rootfs' is set to true only when we're not in initrd and we're
sending SIGKILL, which means the second case. So, we want to emit the
warning when the root of the storage daemon IS the same as that of pid1,
rather than the other way around.

The condition is spuriously reversed in the offending commit.
This commit is contained in:
Mike Yuan 2023-12-02 15:23:51 +08:00 committed by Daan De Meyer
parent b28940ca10
commit 374c29fc88

View File

@ -101,7 +101,7 @@ static bool ignore_proc(const PidRef *pid, bool warn_rootfs) {
return false;
if (warn_rootfs &&
pid_from_same_root_fs(pid->pid) == 0) {
pid_from_same_root_fs(pid->pid) > 0) {
_cleanup_free_ char *comm = NULL;