Merge pull request #18886 from anitazha/shutdownconsole

logging shutdown to /dev/console
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-03-31 10:28:26 +02:00 committed by GitHub
commit bcceabcfc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -322,6 +322,9 @@ int main(int argc, char *argv[]) {
log_set_prohibit_ipc(true);
log_parse_environment();
if (getpid_cached() == 1)
log_set_always_reopen_console(true);
r = parse_argv(argc, argv);
if (r < 0)
goto error;
@ -556,8 +559,10 @@ int main(int argc, char *argv[]) {
sync_with_progress();
if (streq(arg_verb, "exit")) {
if (in_container)
if (in_container) {
log_info("Exiting container.");
return arg_exit_code;
}
cmd = RB_POWER_OFF; /* We cannot exit() on the host, fallback on another method. */
}