]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/execute.c
core: Settle log target if we're going to be closing all fds
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 20 Mar 2023 12:26:57 +0000 (13:26 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 22 Mar 2023 12:20:08 +0000 (13:20 +0100)
commita3b00f91bb985fa10bc33db5c7883e33dbdf83d0
tree6b55bc4b285cfd4c927d6cd11b3d54bc7214ff0c
parent8d0747abb732a5038a1cead30f32d6917f3f702a
core: Settle log target if we're going to be closing all fds

Whenever we're going to close all file descriptors, we tend to close
the log and set it into open when needed mode. When this is done with
the logging target set to LOG_TARGET_AUTO, we run into issues because
for every logging call, we'll check if stderr is connected to the
journal to determine where to send the logging message. This check
obviously stops working when we close stderr, so we settle the log
target before we do that so that we keep using the same logging
target even after stderr is closed.
src/activate/activate.c
src/basic/log.c
src/basic/log.h
src/basic/process-util.c
src/core/execute.c
src/nspawn/nspawn.c
src/test/test-fd-util.c