X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmain.c;h=fcb6e8f9db8d88807084d008f517669b558d5b7c;hb=918f4c69fabadc328b5ca3bbd9eb73c3e486e103;hp=2e6ccfaa30d37f3e7a74234f4722cb296a150b66;hpb=22f4096ca96acd504ac74e7dfad96f07edb6da51;p=elogind.git diff --git a/src/main.c b/src/main.c index 2e6ccfaa3..fcb6e8f9d 100644 --- a/src/main.c +++ b/src/main.c @@ -38,6 +38,7 @@ #include "hostname-setup.h" #include "loopback-setup.h" #include "kmod-setup.h" +#include "locale-setup.h" #include "load-fragment.h" #include "fdset.h" #include "special.h" @@ -119,12 +120,13 @@ _noreturn_ static void crash(int sig) { _exit(1); } else { - int status; + siginfo_t status; + int r; /* Order things nicely. */ - if (waitpid(pid, &status, 0) < 0) - log_error("Caught <%s>, waitpid() failed: %s", signal_to_string(sig), strerror(errno)); - else if (!WCOREDUMP(status)) + if ((r = wait_for_terminate(pid, &status)) < 0) + log_error("Caught <%s>, waitpid() failed: %s", signal_to_string(sig), strerror(-r)); + else if (status.si_code != CLD_DUMPED) log_error("Caught <%s>, core dump failed.", signal_to_string(sig)); else log_error("Caught <%s>, dumped core as pid %lu.", signal_to_string(sig), (unsigned long) pid); @@ -234,15 +236,16 @@ static int set_default_unit(const char *u) { static int parse_proc_cmdline_word(const char *word) { static const char * const rlmap[] = { - "single", SPECIAL_RESCUE_TARGET, - "-s", SPECIAL_RESCUE_TARGET, - "s", SPECIAL_RESCUE_TARGET, - "S", SPECIAL_RESCUE_TARGET, - "1", SPECIAL_RESCUE_TARGET, - "2", SPECIAL_RUNLEVEL2_TARGET, - "3", SPECIAL_RUNLEVEL3_TARGET, - "4", SPECIAL_RUNLEVEL4_TARGET, - "5", SPECIAL_RUNLEVEL5_TARGET + "emergency", SPECIAL_EMERGENCY_TARGET, + "single", SPECIAL_RESCUE_TARGET, + "-s", SPECIAL_RESCUE_TARGET, + "s", SPECIAL_RESCUE_TARGET, + "S", SPECIAL_RESCUE_TARGET, + "1", SPECIAL_RESCUE_TARGET, + "2", SPECIAL_RUNLEVEL2_TARGET, + "3", SPECIAL_RUNLEVEL3_TARGET, + "4", SPECIAL_RUNLEVEL4_TARGET, + "5", SPECIAL_RUNLEVEL5_TARGET, }; assert(word); @@ -992,15 +995,19 @@ int main(int argc, char *argv[]) { install_crash_handler(); 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)); + PACKAGE_STRING " running in %s mode. (" SYSTEMD_FEATURES "; " DISTRIBUTION ")", manager_running_as_to_string(arg_running_as)); if (arg_running_as == MANAGER_SYSTEM && !serialization) { + locale_setup(); + if (arg_show_status) status_welcome(); kmod_setup(); hostname_setup(); loopback_setup(); + + mkdir_p("/dev/.systemd/ask-password/", 0755); } if ((r = manager_new(arg_running_as, &m)) < 0) {