X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmain.c;h=68da330b10b6fc3ca13746ab2b79450abf068aa6;hb=302e27c89ed57f413d2a136fbe66fde32f016aed;hp=79a46b8cd50324f24fdd8e76231677ae0f38b074;hpb=6e98720f14dc25ee1d43f951d5c4d79b04ad7506;p=elogind.git diff --git a/src/main.c b/src/main.c index 79a46b8cd..68da330b1 100644 --- a/src/main.c +++ b/src/main.c @@ -45,6 +45,8 @@ #include "conf-parser.h" #include "bus-errors.h" #include "missing.h" +#include "label.h" +#include "build.h" static enum { ACTION_RUN, @@ -117,10 +119,10 @@ _noreturn_ static void crash(int sig) { _exit(1); } else { - int status, r; + int status; /* Order things nicely. */ - if ((r = waitpid(pid, &status, 0)) < 0) + if (waitpid(pid, &status, 0) < 0) log_error("Caught <%s>, waitpid() failed: %s", signal_to_string(sig), strerror(errno)); else if (!WCOREDUMP(status)) log_error("Caught <%s>, core dump failed.", signal_to_string(sig)); @@ -540,7 +542,7 @@ static int parse_proc_cmdline(void) { char *state; if ((r = read_one_line_file("/proc/cmdline", &line)) < 0) { - log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(errno)); + log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(-r)); return 0; } @@ -987,17 +989,14 @@ int main(int argc, char *argv[]) { if (getpid() == 1) install_crash_handler(); - log_info(PACKAGE_STRING " running in %s mode.", manager_running_as_to_string(arg_running_as)); + log_full(arg_running_as == MANAGER_SYSTEM ? LOG_INFO : LOG_DEBUG, + PACKAGE_STRING " running in %s mode. (" SYSTEMD_FEATURES ")", manager_running_as_to_string(arg_running_as)); if (arg_running_as == MANAGER_SYSTEM) { /* Disable nscd, to avoid deadlocks when systemd uses * NSS and the nscd socket is maintained by us. */ - /* if (nss_disable_nscd) { */ - /* log_debug("Disabling nscd"); */ - /* nss_disable_nscd(); */ - /* } else */ - /* log_debug("Hmm, can't disable nscd."); */ + nss_disable_nscd(); if (!serialization) { if (arg_show_status)