X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmain.c;h=c1b0ffd9bb1e66e36bd75358dd5d077c47183d37;hb=99a17ada9caa8e190b5cafa5cd3c19618feeff48;hp=6ebfe64187d994916de8c9479e64100a8136d1a7;hpb=73b80ec2d999c45ce13f3e034704249d80829f7e;p=elogind.git diff --git a/src/core/main.c b/src/core/main.c index 6ebfe6418..c1b0ffd9b 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -108,6 +108,8 @@ 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 usec_t arg_default_cpu_quota_period_usec = 100 * USEC_PER_MSEC; static Set* arg_syscall_archs = NULL; static FILE* arg_serialization = NULL; static bool arg_default_cpu_accounting = false; @@ -240,7 +242,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; } @@ -411,18 +413,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; @@ -686,6 +683,8 @@ 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", "DefaultCPUQuotaPeriodSec", config_parse_sec, 0, &arg_default_cpu_quota_period_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 }, @@ -1185,21 +1184,6 @@ static void test_usr(void) { "Consult http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken for more information."); } -static void test_cgroups(void) { - - if (access("/proc/cgroups", F_OK) >= 0) - return; - - log_warning("CONFIG_CGROUPS was not set when your kernel was compiled. " - "Systems without control groups are not supported. " - "We will now sleep for 10s, and then continue boot-up. " - "Expect breakage and please do not file bugs. " - "Instead fix your kernel and enable CONFIG_CGROUPS. " - "Consult http://0pointer.de/blog/projects/cgroups-vs-cgroups.html for more information."); - - sleep(10); -} - static int initialize_join_controllers(void) { /* By default, mount "cpu" + "cpuacct" together, and "net_cls" * + "net_prio". We'd like to add "cpuset" to the mix, but @@ -1582,12 +1566,11 @@ int main(int argc, char *argv[]) { kmod_setup(); #endif hostname_setup(); - machine_id_setup(); + machine_id_setup(""); loopback_setup(); test_mtab(); test_usr(); - test_cgroups(); } if (arg_running_as == SYSTEMD_SYSTEM && arg_runtime_watchdog > 0) @@ -1635,6 +1618,8 @@ int main(int argc, char *argv[]) { } m->confirm_spawn = arg_confirm_spawn; + m->default_timer_accuracy_usec = arg_default_timer_accuracy_usec; + m->default_cpu_quota_period_usec = arg_default_cpu_quota_period_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; @@ -1994,7 +1979,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;