[systemd-devel] [PATCH] udevadm-settle: exit if event execution is disable, even if queue is not empty.

Robert Milasan rmilasan at suse.com
Fri Jan 23 05:13:20 PST 2015


How to reproduce:

run: udevadm control --stop-exec-queue
add: new device, for example a usb stick/disk 
     (it will create /run/udev/queue)
run: udevadm settle --timeout=10

The last command will hang/stall, because it checks constantly
for /run/udev/queue, which exists and always will unless the user
doesn't start the event execution or deletes manually /run/udev/queue.

Signed-off-by: Robert Milasan <rmilasan at suse.com>
---
 src/udev/udevadm-settle.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c
index 6bcb3a9..80529ce 100644
--- a/src/udev/udevadm-settle.c
+++ b/src/udev/udevadm-settle.c
@@ -116,6 +116,11 @@ static int adm_settle(struct udev *udev, int argc,
char *argv[]) { udev_ctrl_unref(uctrl);
                                 return EXIT_SUCCESS;
                         }
+                        if (udev_ctrl_get_stop_exec_queue(uctrl) < 0) {
+                                log_debug("event execution disabled");
+                                udev_ctrl_unref(uctrl);
+                                return EXIT_SUCCESS;
+                        }
                         udev_ctrl_unref(uctrl);
                 }
         }
-- 
1.8.4.5


More information about the systemd-devel mailing list