Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to troubleshoot udev rules?

218 views
Skip to first unread message

Anton Shepelev

unread,
Mar 9, 2011, 5:08:11 AM3/9/11
to
Hello all,

I have installed the ipheth package to be able to
use an iPhone as a modem, and it does work well
except that I have to manually call the
'ipheth-pair' command after an iPhone has been
plugged in, becase the udev rule intended to do this
does not seem to work.

I have made sure that udev is running on my machine,
so I need your help in determining what is wrong
with the rule:

ACTION=="add", ENV{ID_USB_DRIVER}=="ipheth",SYMLINK+="iphone",
RUN+="ipheth-pair"

I wonder, who is supposed to assign the environment
variable ID_USB_DRIVER...

Anton

J G Miller

unread,
Mar 9, 2011, 11:06:54 AM3/9/11
to
On Wednesday, March 9th, 2011 at 13:08:11h +0300, Anton Shepelev pondered:

> I wonder, who is supposed to assign the environment variable
> ID_USB_DRIVER...

Apologies for not answering your question, since I do not know who
is supposed to assign the appropriate value to the environment
variable other than that assigned by the udev system its-self.

Please note that environment variables in udev are not the same
as those in the shell.

<http://reactivated.NET/writing_udev_rules.html#env>

My suggestion to get this to work would but to not use the ENV
condition but use a condition based upon SUBSYSTEM and then
the ATTRS condition using manufacturer, product, serial number
etc as appropriate.

Numerous such examples are given at the above web page.

Jerry Peters

unread,
Mar 9, 2011, 3:59:20 PM3/9/11
to

Read man udevadm. You want the "monitor --environment" option.
Issue the udevadm command in a terminal window, then plug in the
device, udevadm will show you all of the events that udev generates.

Jerry

Anton Shepelev

unread,
Mar 10, 2011, 2:30:43 PM3/10/11
to
J G Miller:

> Apologies for not answering your question, since I

> do not know who is supposed to assign the appro-


> priate value to the environment variable other
> than that assigned by the udev system its-self.

> [...]

Awww, you needn't apologize for that :)

> My suggestion to get this to work would but to not
> use the ENV condition but use a condition based
> upon SUBSYSTEM and then the ATTRS condition using

> manufacturer, product, serial number etc as appro-
> priate.

Thanks for the advice. I'll try it if I fail to
trace down why the original rule isn't triggered.
Identification by drver name seems 'cleaner' to me.

Anton

Anton Shepelev

unread,
Mar 10, 2011, 2:31:22 PM3/10/11
to
Jerry Peters:

> Read man udevadm. You want the "monitor
> --environment" option.

Thank you.

Anton

J G Miller

unread,
Mar 10, 2011, 5:17:34 PM3/10/11
to
On Thursday, March 10th, 2011 at 22:30:43h +0300, Anton Shepelev wrote:

> if I fail to trace down why the original rule isn't
> triggered. Identification by drver name seems 'cleaner' to me.

But if you do get it working that why, it would be very useful
if you could report back with an explanation.

0 new messages