chiark / gitweb /
ask-password: extend help text a little
[elogind.git] / src / main.c
index dc561a9b80356bb0d03d7e3a49590956e541814c..fcb6e8f9db8d88807084d008f517669b558d5b7c 100644 (file)
@@ -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);
@@ -996,12 +998,16 @@ int main(int argc, char *argv[]) {
                  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) {