X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmain.c;h=feabead96d7567fb8609508c43ed34213e180d93;hb=d38f6e34a618e2d100b06888e0810f776eb83510;hp=18d0927b7a4191c2814b68effc2ea57360bacae9;hpb=059cb3858acd038ff2cef10a3a99119bf71a8fc6;p=elogind.git diff --git a/src/core/main.c b/src/core/main.c index 18d0927b7..feabead96 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -108,6 +108,7 @@ static char **arg_default_environment = NULL; static struct rlimit *arg_default_rlimit[_RLIMIT_MAX] = {}; static uint64_t arg_capability_bounding_set_drop = 0; static nsec_t arg_timer_slack_nsec = (nsec_t) -1; +static usec_t arg_default_timer_accuracy_usec = 1 * USEC_PER_MINUTE; static Set* arg_syscall_archs = NULL; static FILE* arg_serialization = NULL; static bool arg_default_cpu_accounting = false; @@ -240,7 +241,7 @@ static int console_setup(bool do_reset) { if (r < 0) log_error("Failed to reset /dev/console: %s", strerror(-r)); - close_nointr_nofail(tty_fd); + safe_close(tty_fd); return r; } @@ -374,6 +375,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value) { log_warning("Environment variable name '%s' is not valid. Ignoring.", value); } else if (!streq(key, "systemd.restore_state") && + !streq(key, "systemd.gpt_auto") && (startswith(key, "systemd.") || startswith(key, "rd.systemd."))) { const char *c; @@ -410,18 +412,13 @@ static int parse_proc_cmdline_item(const char *key, const char *value) { } } else if (streq(key, "quiet") && !value) { - if (arg_show_status == _SHOW_STATUS_UNSET) arg_show_status = SHOW_STATUS_AUTO; } else if (streq(key, "debug") && !value) { - - /* Log to kmsg, the journal socket will fill up before the - * journal is started and tools running during that time - * will block with every log message for for 60 seconds, - * before they give up. */ log_set_max_level(LOG_DEBUG); - log_set_target(detect_container(NULL) > 0 ? LOG_TARGET_CONSOLE : LOG_TARGET_KMSG); + if (detect_container(NULL) > 0) + log_set_target(LOG_TARGET_CONSOLE); } else if (!in_initrd() && !value) { unsigned i; @@ -685,6 +682,7 @@ static int parse_config_file(void) { { "Manager", "SystemCallArchitectures", config_parse_syscall_archs, 0, &arg_syscall_archs }, #endif { "Manager", "TimerSlackNSec", config_parse_nsec, 0, &arg_timer_slack_nsec }, + { "Manager", "DefaultTimerAccuracySec", config_parse_sec, 0, &arg_default_timer_accuracy_usec }, { "Manager", "DefaultStandardOutput", config_parse_output, 0, &arg_default_std_output }, { "Manager", "DefaultStandardError", config_parse_output, 0, &arg_default_std_error }, { "Manager", "DefaultTimeoutStartSec", config_parse_sec, 0, &arg_default_timeout_start_usec }, @@ -1581,7 +1579,7 @@ int main(int argc, char *argv[]) { kmod_setup(); #endif hostname_setup(); - machine_id_setup(); + machine_id_setup(""); loopback_setup(); test_mtab(); @@ -1634,6 +1632,7 @@ int main(int argc, char *argv[]) { } m->confirm_spawn = arg_confirm_spawn; + m->default_timer_accuracy_usec = arg_default_timer_accuracy_usec; m->default_std_output = arg_default_std_output; m->default_std_error = arg_default_std_error; m->default_restart_usec = arg_default_restart_usec; @@ -1993,7 +1992,7 @@ finish: if (log_get_show_location()) command_line[pos++] = "--log-location"; - assert(pos + 1 < ELEMENTSOF(command_line)); + assert(pos < ELEMENTSOF(command_line)); if (arm_reboot_watchdog && arg_shutdown_watchdog > 0) { char *e;