]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not start device monitor if /sys is read-only
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Sep 2020 14:26:28 +0000 (23:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Sep 2020 21:39:05 +0000 (06:39 +0900)
Follow-up for bf331d87171b7750d1c72ab0b140a240c0cf32c3.

src/network/networkd-manager.c

index 5ed9cce1cad966569e0e6a58233880e48a1fe173..bb1df8cca60007eb47ee3da164253205a870b917 100644 (file)
 #include "path-util.h"
 #include "set.h"
 #include "signal-util.h"
+#include "stat-util.h"
 #include "strv.h"
 #include "sysctl-util.h"
 #include "tmpfile-util.h"
 #include "udev-util.h"
-#include "virt.h"
 
 /* use 128 MB for receive socket kernel queue. */
 #define RCVBUF_SIZE    (128*1024*1024)
@@ -261,10 +261,9 @@ static int manager_udev_process_link(sd_device_monitor *monitor, sd_device *devi
 static int manager_connect_udev(Manager *m) {
         int r;
 
-        /* udev does not initialize devices inside containers,
-         * so we rely on them being already initialized before
-         * entering the container */
-        if (detect_container() > 0)
+        /* udev does not initialize devices inside containers, so we rely on them being already
+         * initialized before entering the container. */
+        if (path_is_read_only_fs("/sys") > 0)
                 return 0;
 
         r = sd_device_monitor_new(&m->device_monitor);