]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: load a bunch of libs before we fork off worker processes
authorLennart Poettering <lennart@poettering.net>
Fri, 21 Nov 2025 07:53:44 +0000 (08:53 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Nov 2025 10:56:47 +0000 (11:56 +0100)
src/udev/meson.build
src/udev/udevd.c

index 555e83fa7fa56d4334af03665aee2a69e26781a0..7df5b3de857b1428f2e3ae201169ad09f08d1adf 100644 (file)
@@ -116,7 +116,8 @@ endif
 udev_dependencies = [
         libacl_cflags,
         libblkid_cflags,
-        libkmod,
+        libkmod_cflags,
+        libmount_cflags,
         threads,
 ]
 
index fd16654127ea3bead9521198fa87b396508b1a32..ab3106334bee7b0763c48bd9e2c5d7ee430b4205 100644 (file)
@@ -8,10 +8,14 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include "acl-util.h"
+#include "blkid-util.h"
 #include "errno-util.h"
 #include "fd-util.h"
 #include "label-util.h"
+#include "libmount-util.h"
 #include "log.h"
+#include "module-util.h"
 #include "process-util.h"
 #include "rlimit-util.h"
 #include "terminal-util.h"
@@ -52,6 +56,12 @@ int run_udevd(int argc, char *argv[]) {
         if (r < 0 && r != -EEXIST)
                 return log_error_errno(r, "Failed to create /run/udev: %m");
 
+        /* Load some shared libraries before we fork any workers */
+        (void) dlopen_libacl();
+        (void) dlopen_libblkid();
+        (void) dlopen_libkmod();
+        (void) dlopen_libmount();
+
         if (arg_daemonize) {
                 pid_t pid;