diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-22 00:35:00 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-02-22 00:35:00 +0100 |
commit | 0b1f3c768ce1bd1490a5e53f539976dcef8ca765 (patch) | |
tree | 913fbc34316957cd4c07ef0b3fb0fb06a005851d /src/delta/delta.c | |
parent | shutdown: explicitly set a log target in shutdown.c (diff) | |
download | systemd-0b1f3c768ce1bd1490a5e53f539976dcef8ca765.tar.xz systemd-0b1f3c768ce1bd1490a5e53f539976dcef8ca765.zip |
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.
Diffstat (limited to 'src/delta/delta.c')
-rw-r--r-- | src/delta/delta.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/delta/delta.c b/src/delta/delta.c index 645b0b2278..4fe89ff9b0 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -191,6 +191,7 @@ static int found_override(const char *top, const char *bottom) { return r; if (r == 0) { execlp("diff", "diff", "-us", "--", bottom, top, NULL); + log_open(); log_error_errno(errno, "Failed to execute diff: %m"); _exit(EXIT_FAILURE); } |