summaryrefslogtreecommitdiff
path: root/src/activate
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-03-20 13:26:57 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-03-22 13:20:08 +0100
commita3b00f91bb985fa10bc33db5c7883e33dbdf83d0 (patch)
tree6b55bc4b285cfd4c927d6cd11b3d54bc7214ff0c /src/activate
parent8d0747abb732a5038a1cead30f32d6917f3f702a (diff)
downloadsystemd-a3b00f91bb985fa10bc33db5c7883e33dbdf83d0.tar.gz
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.
Diffstat (limited to 'src/activate')
-rw-r--r--src/activate/activate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/activate/activate.c b/src/activate/activate.c
index ea141c54bd..4a63970326 100644
--- a/src/activate/activate.c
+++ b/src/activate/activate.c
@@ -81,6 +81,7 @@ static int open_sockets(int *ret_epoll_fd, bool accept) {
log_close();
log_set_open_when_needed(true);
+ log_settle_target();
r = close_all_fds(except, n);
if (r < 0)