]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevadm-settle: improve logs when we cannot access /run/udev/control
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 31 Aug 2022 15:09:28 +0000 (00:09 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 31 Aug 2022 21:26:06 +0000 (22:26 +0100)
Addresses https://github.com/systemd/systemd/pull/24474#discussion_r959696663.

src/udev/udevadm-settle.c

index 9de25ae678000384053fe5c0bfda25a1c295de2f..f093b7cbe8acd099009774f6c8cf76afe78e0fe1 100644 (file)
@@ -217,8 +217,11 @@ int settle_main(int argc, char *argv[], void *userdata) {
                         return log_error_errno(r, "Failed to wait for daemon to reply: %m");
         } else {
                 /* For non-privileged users, at least check if udevd is running. */
-                if (access("/run/udev/control", F_OK) < 0)
-                        return log_error_errno(errno, "udevd is not running.");
+                if (access("/run/udev/control", F_OK) < 0) {
+                        if (errno == ENOENT)
+                                return log_error_errno(errno, "systemd-udevd is not running.");
+                        return log_error_errno(errno, "Failed to check if /run/udev/control exists: %m");
+                }
         }
 
         r = sd_event_default(&event);