linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Jellinghaus <aj@dungeon.inka.de>
To: linux-hotplug@vger.kernel.org
Subject: udev/ubuntu problem solved
Date: Tue, 10 Jul 2007 14:53:31 +0000	[thread overview]
Message-ID: <200707101653.31621.aj@dungeon.inka.de> (raw)

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

             reply	other threads:[~2007-07-10 14:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10 14:53 Andreas Jellinghaus [this message]
2007-07-10 15:39 ` udev/ubuntu problem solved 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200707101653.31621.aj@dungeon.inka.de \
    --to=aj@dungeon.inka.de \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).