chiark / gitweb /
kmod: automatically load a few kernel modules we need for normal operation before...
[elogind.git] / src / main.c
index e2d2ab5e647ad83bf8cf2442f4982cd6a1eff5bd..95d2115230308ff8437149ec3075d9dbd13bf345 100644 (file)
@@ -37,6 +37,7 @@
 #include "mount-setup.h"
 #include "hostname-setup.h"
 #include "loopback-setup.h"
+#include "kmod-setup.h"
 #include "load-fragment.h"
 #include "fdset.h"
 
@@ -138,7 +139,7 @@ _noreturn static void crash(int sig) {
                 else if (pid == 0) {
                         int fd, r;
 
-                        if ((fd = acquire_terminal("/dev/console", false, true)) < 0)
+                        if ((fd = acquire_terminal("/dev/console", false, true, true)) < 0)
                                 log_error("Failed to acquire terminal: %s", strerror(-fd));
                         else if ((r = make_stdio(fd)) < 0)
                                 log_error("Failed to duplicate terminal fd: %s", strerror(-r));
@@ -175,7 +176,7 @@ static void install_crash_handler(void) {
 static int make_null_stdio(void) {
         int null_fd, r;
 
-        if ((null_fd = open("/dev/null", O_RDWR)) < 0) {
+        if ((null_fd = open("/dev/null", O_RDWR|O_NOCTTY)) < 0) {
                 log_error("Failed to open /dev/null: %m");
                 return -errno;
         }
@@ -639,6 +640,7 @@ int main(int argc, char *argv[]) {
         log_debug("systemd running in %s mode.", manager_running_as_to_string(running_as));
 
         if (running_as == MANAGER_INIT) {
+                kmod_setup();
                 hostname_setup();
                 loopback_setup();
         }