Re: Ordering hotplug scripts vs. udev device node creation

From: Andrey Borzenkov
Date: Mon Oct 23 2006 - 22:46:36 EST


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 23 October 2006 23:26, Aaron Cohen wrote:
> Adding a USB device seems to work correctly (more or less, my script
> is invoked a few too many times but I think I can figure out how to
> adjust my rule) using this. I'm having trouble now with removal
> though. By the time my script runs the device file has been removed
> by udev and I can't look it up through udevinfo any longer. I need to
> know what the name of the device file was so I can tell gpsd to stop
> monitoring it.
>
> Any ideas?

udev sets DEVNAME and DEVLINKS environment before calling RUN program. You can
either pass them directly like

RUN+="/your/program env{DEVNAME} env{DEVLINKS}"

or your program can get them from environment. It unfortunately seems to be
not documented.

HTH

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFPX5YR6LMutpd94wRAsDrAJ92kOTrofNo3kg/5xW0C6bzm5TlDACg0/NG
K4R+tBQzCHJSN+XW5WBPghE=
=ZIet
-----END PGP SIGNATURE-----
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/