From: Andreas Jellinghaus Date: Tue, 10 Jul 2007 14:53:31 +0000 Subject: udev/ubuntu problem solved Message-Id: <200707101653.31621.aj@dungeon.inka.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org I finally figured out what is wrong with udev on ubuntu. ubuntu mounts usbfs as /proc/bus/usb/.usbfs and has udev create /dev/bus/usb and bind-mounts that as /proc/bus/usb. so even though I get events for /proc/bus/usb/NNN/NNN devices and they exist if I manually look, my app doesn't find them. the reason is: udev runs /lib/udev/openct_usb, but creates the device in /dev/bus/usb (and thus on ubuntu /proc/bus/usb) only after my script finishes. while I can add sleeps to avoid races, they don't help because udev will not create the device until my script gives up. the solution is to add some ( ... ) & disown %1 exit 0 in my script so the core code runs in the background, where it can wait for the device file to be created by udev and then start the ifdhandler process that will handle it. also during debugging I noticed: it is not a good idea to start/stop udev using the init script. at first I thought udev wasn't re-reading it rules properly, so I tried that. but the result of restarting udev init script is this: /proc/bus/usb is no longer a bind mount of /dev/bus/usb. instead it is an independend copy, and it is no longer updated at all. thus new devices show up only in /dev/bus/usb and /proc/bus/usb/.usbfs, but not in /proc/bus/usb/. Regards, Andreas ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel