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

2015-01-23 Thread Kay Sievers
On Fri, Jan 23, 2015 at 2:13 PM, Robert Milasan rmila...@suse.com wrote:
 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 rmila...@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) {

How does udev_ctrl_get_stop_exec_queue() operate on a ctrl object and not a msg?

How would udevadm process incoming control packets, or know that way
about the state of the running daemon?

If the event execution is disabled, there are pending events and
settle should block.

The entire idea of disabling the even handling is very questionable,
what are you trying to do/fix here?

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2015-01-23 Thread Robert Milasan
On Fri, 23 Jan 2015 14:31:28 +0100
Kay Sievers k...@vrfy.org wrote:
 
 How does udev_ctrl_get_stop_exec_queue() operate on a ctrl object and
 not a msg?
 
 How would udevadm process incoming control packets, or know that way
 about the state of the running daemon?
 
 If the event execution is disabled, there are pending events and
 settle should block.
 
 The entire idea of disabling the even handling is very questionable,
 what are you trying to do/fix here?
 
 Kay
 

Ahh, damn, I didn't even notice that. Sorry, ignore the patch, but at
least maybe --timeout option in man pages should be rewritten, its not
very clear if for example we stop the exec_queue.

-- 
Robert Milasan

L3 Support Engineer
SUSE Linux (http://www.suse.com)
email: rmila...@suse.com
GPG fingerprint: B6FE F4A8 0FA3 3040 3402  6FE7 2F64 167C 1909 6D1A
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2015-01-23 Thread Robert Milasan
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 rmila...@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
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel