[systemd-devel] [PATCH] udevadm-settle: exit if event execution is disable, even if queue is not empty.
Kay Sievers
kay at vrfy.org
Fri Jan 23 05:31:28 PST 2015
On Fri, Jan 23, 2015 at 2:13 PM, Robert Milasan <rmilasan at 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 <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) {
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
More information about the systemd-devel
mailing list