RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 851974 - udev rule ordering ignored
Summary: udev rule ordering ignored
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: hal
Version: 6.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard Hughes
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks: 1270825
TreeView+ depends on / blocked
 
Reported: 2012-08-27 07:52 UTC by Marko Myllynen
Modified: 2017-12-06 12:24 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-06 12:24:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Marko Myllynen 2012-08-27 07:52:50 UTC
Description of problem:
When executing a simple script to debug udev rules [1] in /etc/udev/rules.d/10-test.rules [2], then udevadm test --action=add ... prints the actions to be executed for the target device as follows:

...
udevadm_test: run: '/tmp/test.sh add'
udevadm_test: run: 'socket:@/org/freedesktop/hal/udev_event

And when using /etc/udev/rules.d/99-test.rules instead, the ordering is changed (as expected):

...
udevadm_test: run: 'socket:@/org/freedesktop/hal/udev_event
udevadm_test: run: '/tmp/test.sh add'

But when actually inserting a device that matches the rules it can be seen from /var/log/messages that actually the test script is always executed before hal/udev_event (which triggers pcscd to initialize an etoken USB device on my test system, thus a custom script will fail to access the etoken device as it is not yet initialized properly by pcscd).

1)
localhost:~# cat /tmp/test.sh
#!/bin/sh
sleep 10
logger $0 $@ invoked

2)
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="/tmp/test.sh add"

Version-Release number of selected component (if applicable):
RHEL 6.3

Comment 2 Harald Hoyer 2012-09-06 10:35:48 UTC
Well, there is no guarantee, that after sending to 'socket:@/org/freedesktop/hal/udev_event' the initialization of the etoken device is immediately complete, when your test.sh is run. Maybe your test.sh should be triggered by hal then after the initialization and not by the udev event.

Comment 3 Marko Myllynen 2012-09-06 12:50:02 UTC
(In reply to comment #2)
> Well, there is no guarantee, that after sending to
> 'socket:@/org/freedesktop/hal/udev_event' the initialization of the etoken
> device is immediately complete, when your test.sh is run. Maybe your test.sh
> should be triggered by hal then after the initialization and not by the udev
> event.

This particular case I referred was just an example to illustrate that udev ignoring its own ordering rules is causing issues. I've already created a work around for this particular issue but IMHO udev should be fixed to follow its own rules.

Thanks.

Comment 4 Kay Sievers 2012-09-20 13:02:15 UTC
If I understand this issue correctly:

HAL is an asynchronous event-driven mechanism and does not block udev rules execution.

The event is delivered to HAL in the proper udev rules order, but executed by
HAL at any later time. 

I don't think you can expect a defined order when udev and HAL hooks are mixed,
they are just non synchronized, and this is the expected behaviour.

Comment 5 Marko Myllynen 2012-09-21 08:37:51 UTC
(In reply to comment #4)
> If I understand this issue correctly:
> 
> HAL is an asynchronous event-driven mechanism and does not block udev rules
> execution.
> 
> The event is delivered to HAL in the proper udev rules order, but executed by
> HAL at any later time. 

No, I don't think this is the case since in the example script there could be even something like "sleep 3600" and HAL still doesn't do anything meanwhile but only instantly after the script exits so it seems clearly indicate that the event is not delivered to HAL in the order manifested by udevadm test.

Thanks.

Comment 7 RHEL Program Management 2013-10-14 04:49:57 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 9 Michal Sekletar 2015-10-19 13:49:11 UTC
(In reply to Marko Myllynen from comment #5)

> No, I don't think this is the case since in the example script there could
> be even something like "sleep 3600" and HAL still doesn't do anything
> meanwhile but only instantly after the script exits so it seems clearly
> indicate that the event is not delivered to HAL in the order manifested by
> udevadm test.

I tried to reproduce this now, but in my case (KVM, in 99-test.rules trigger is addition of block device + running hal from command line with --daemon=no --verbose=yes) I can see from log produced by hal that it is notified about event *before* test script finishes. Reassigning to hal.

Comment 13 Jan Kurik 2017-12-06 12:24:27 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/


Note You need to log in before you can comment on or make changes to this bug.