]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shutdown/umount.c
tree-wide: reopen log when we need to log in FORK_CLOSE_ALL_FDS children 8246/head
authorLennart Poettering <lennart@poettering.net>
Wed, 21 Feb 2018 23:35:00 +0000 (00:35 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Feb 2018 23:35:00 +0000 (00:35 +0100)
commit0b1f3c768ce1bd1490a5e53f539976dcef8ca765
tree913fbc34316957cd4c07ef0b3fb0fb06a005851d
parente18805fbd0b42b0c689af985bfb7d5cc8148e49e
tree-wide: reopen log when we need to log in FORK_CLOSE_ALL_FDS children

In a number of occasions we use FORK_CLOSE_ALL_FDS when forking off a
child, since we don't want to pass fds to the processes spawned (either
because we later want to execve() some other process there, or because
our child might hang around for longer than expected, in which case it
shouldn't keep our fd pinned). This also closes any logging fds, and
thus means logging is turned off in the child. If we want to do proper
logging, explicitly reopen the logs hence in the child at the right
time.

This is particularly crucial in the umount/remount children we fork off
the shutdown binary, as otherwise the children can't log, which is
why #8155 is harder to debug than necessary: the log messages we
generate about failing mount() system calls aren't actually visible on
screen, as they done in the child processes where the log fds are
closed.
src/core/umount.c
src/coredump/coredumpctl.c
src/delta/delta.c
src/login/inhibit.c