mirror of
https://github.com/systemd/systemd
synced 2024-09-16 06:43:18 +00:00
Merge pull request #18886 from anitazha/shutdownconsole
logging shutdown to /dev/console
This commit is contained in:
commit
bcceabcfc2
|
@ -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. */
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue