static void nop_handler(int sig) {
}
-_noreturn_ static void crash(int sig) {
+noreturn static void crash(int sig) {
if (getpid() != 1)
/* Pass this on immediately, if this is not PID 1 */
* will block with every log message for for 60 seconds,
* before they give up. */
log_set_max_level(LOG_DEBUG);
- log_set_target(LOG_TARGET_KMSG);
+ log_set_target(detect_container(NULL) > 0 ? LOG_TARGET_CONSOLE : LOG_TARGET_KMSG);
} else if (!in_initrd()) {
unsigned i;
/* Running inside a container, as PID 1 */
arg_running_as = SYSTEMD_SYSTEM;
log_set_target(LOG_TARGET_CONSOLE);
+ log_close_console(); /* force reopen of /dev/console */
log_open();
/* For the later on, see above... */
status_welcome();
#ifdef HAVE_KMOD
- kmod_setup();
+ if (detect_container(NULL) <= 0)
+ kmod_setup();
#endif
hostname_setup();
machine_id_setup();
if (arg_running_as == SYSTEMD_SYSTEM)
bump_rlimit_nofile(&saved_rlimit_nofile);
- r = manager_new(arg_running_as, !!serialization, &m);
+ r = manager_new(arg_running_as, &m);
if (r < 0) {
log_error("Failed to allocate manager object: %s", strerror(-r));
goto finish;