X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmain.c;h=b44e7f9cddb3f3754e420f6fffab303c8b21aa20;hb=056edeb9102c5ba455e1a54af70f282b6138ca33;hp=d563ae35092353d2c3a2e2f30a38dfe51eb1759c;hpb=63cc4c3138fd0ce9cc97884373a2dd8959a13ee9;p=elogind.git diff --git a/src/core/main.c b/src/core/main.c index d563ae350..b44e7f9cd 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -75,9 +75,7 @@ #include "selinux-setup.h" #include "ima-setup.h" #include "smack-setup.h" -#ifdef HAVE_KMOD #include "kmod-setup.h" -#endif static enum { ACTION_RUN, @@ -1389,6 +1387,11 @@ int main(int argc, char *argv[]) { /* Mount /proc, /sys and friends, so that /proc/cmdline and * /proc/$PID/fd is available. */ if (getpid() == 1) { + + /* Load the kernel modules early, so that we kdbus.ko is loaded before kdbusfs shall be mounted */ + if (!skip_setup) + kmod_setup(); + r = mount_setup(loaded_policy); if (r < 0) goto finish; @@ -1553,10 +1556,6 @@ int main(int argc, char *argv[]) { if (arg_show_status > 0 || plymouth_running()) status_welcome(); -#ifdef HAVE_KMOD - kmod_setup(); -#endif - mount_setup_late(); hostname_setup(); machine_id_setup(NULL); loopback_setup(); @@ -1800,10 +1799,7 @@ int main(int argc, char *argv[]) { finish: pager_close(); - if (m) { - manager_free(m); - m = NULL; - } + m = manager_free(m); for (j = 0; j < ELEMENTSOF(arg_default_rlimit); j++) { free(arg_default_rlimit[j]);