linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev/ubuntu problem solved
@ 2007-07-10 14:53 Andreas Jellinghaus
  2007-07-10 15:39 ` Kay Sievers
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Andreas Jellinghaus @ 2007-07-10 14:53 UTC (permalink / raw)
  To: linux-hotplug

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-07-13  8:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-10 14:53 udev/ubuntu problem solved Andreas Jellinghaus
2007-07-10 15:39 ` Kay Sievers
2007-07-10 15:46 ` Andreas Jellinghaus
2007-07-10 16:19 ` Kay Sievers
2007-07-11  7:32 ` Andreas Jellinghaus
2007-07-11  8:34 ` Scott James Remnant
2007-07-11 10:09 ` Kay Sievers
2007-07-12  0:35 ` Greg KH
2007-07-12  8:52 ` Scott James Remnant
2007-07-12 16:09 ` Greg KH
2007-07-12 16:58 ` Scott James Remnant
2007-07-12 18:37 ` Greg KH
2007-07-13  8:44 ` Scott James Remnant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).