]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: reconnect to the console before being re-executed
authorFranck Bui <fbui@suse.com>
Mon, 13 Jun 2016 14:10:06 +0000 (16:10 +0200)
committerFranck Bui <fbui@suse.com>
Mon, 20 Jun 2016 16:40:51 +0000 (18:40 +0200)
When re-executed, reconnect the console to PID1's stdios as it was the case
when PID1 was initially started by the kernel.

src/core/main.c

index 93098daa9b4343cbbbf3b0bb718a528a96dddc80..cef757593749a94d9fdd52290e02f1e44b8b82cf 100644 (file)
@@ -1967,6 +1967,9 @@ finish:
                                 log_error_errno(r, "Failed to switch root, trying to continue: %m");
                 }
 
+                /* Reopen the console */
+                (void) make_console_stdio();
+
                 args_size = MAX(6, argc+1);
                 args = newa(const char*, args_size);
 
@@ -2018,9 +2021,6 @@ finish:
                 arg_serialization = safe_fclose(arg_serialization);
                 fds = fdset_free(fds);
 
-                /* Reopen the console */
-                (void) make_console_stdio();
-
                 for (j = 1, i = 1; j < (unsigned) argc; j++)
                         args[i++] = argv[j];
                 args[i++] = NULL;