]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
executor: move reopening of the console after option parsing 41618/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Mon, 13 Apr 2026 12:20:43 +0000 (14:20 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Tue, 14 Apr 2026 08:50:37 +0000 (10:50 +0200)
It seems to be interfering with systemd:check-help-systemd-executor
test in CI. In practice, any messages from parse_argv() are going
to be from manual invocations, since if called from PID1 the option
syntax is going to be correct. So I hope this fixes the redirection
of --help but otherwise is of little consequence.

src/core/executor.c

index 8089d376fe8305fe053fb6c6f6ef82b5cb9eadc4..94bb481db43a49bda710c2605e2fb35f3c5d4c65 100644 (file)
@@ -156,7 +156,6 @@ static int run(int argc, char *argv[]) {
         cgroup_context_init(&cgroup_context);
 
         /* We might be starting the journal itself, we'll be told by the caller what to do */
-        log_set_always_reopen_console(true);
         log_set_prohibit_ipc(true);
         log_setup();
 
@@ -165,6 +164,7 @@ static int run(int argc, char *argv[]) {
                 return r;
 
         /* Now that we know the intended log target, allow IPC and open the final log target. */
+        log_set_always_reopen_console(true);
         log_set_prohibit_ipc(false);
         log_open();