]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
execute: make use of the new logging mode in execute.c
authorLennart Poettering <lennart@poettering.net>
Tue, 26 Sep 2017 15:45:32 +0000 (17:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 26 Sep 2017 15:46:34 +0000 (17:46 +0200)
src/core/execute.c

index 54e4043253152ed4200465e3e98b3e914bb79005..edeb857e15549ba52ddc3425c98eefddf215735d 100644 (file)
@@ -2466,11 +2466,13 @@ static int exec_child(
         if (params->idle_pipe)
                 do_idle_pipe_dance(params->idle_pipe);
 
-        /* Close sockets very early to make sure we don't
-         * block init reexecution because it cannot bind its
-         * sockets */
+        /* Close fds we don't need very early to make sure we don't block init reexecution because it cannot bind its
+         * sockets. Among the fds we close are the logging fds, and we want to keep them closed, so that we don't have
+         * any fds open we don't really want open during the transition. In order to make logging work, we switch the
+         * log subsystem into open_when_needed mode, so that it reopens the logs on every single log call. */
 
         log_forget_fds();
+        log_set_open_when_needed(true);
 
         n_fds = n_storage_fds + n_socket_fds;
         r = close_remaining_fds(params, runtime, dcreds, user_lookup_fd, socket_fd, fds, n_fds);