Depending on the SYSFS key, pci-hotplug looks for USB devices at boot time, and if not present, hotplug stalls the boot process (ie, it freezes). Not all keys cause this behavior, but for custom rules sometimes only pci...usb.. device keys are available (since a unique key is required). Reproducible: Always Steps to Reproduce: 1. use a pci/usb key for a custom rule in a pure udev system 2. remove device, shutdown, startup and check for pci-hotplug error 3. Actual Results: freezes at Starting pci-hotplug... Expected Results: should startup normally ================================================================= System uname: 2.6.4 i686 AMD Athlon(tm) XP 2000+ Gentoo Base System version 1.4.3.13p1 distcc 2.12.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] Autoconf: sys-devel/autoconf-2.58-r1 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=i686 -mcpu=athlon-xp -Os -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=i686 -mcpu=athlon-xp -Os -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache cvs sandbox userpriv usersandbox" GENTOO_MIRRORS="http://megatron.arnolds.bogus/gentoo/" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://megatron.arnolds.bogus/gentoo-portage" USE="3dnow X aalib acl acpi alsa apm arts avi bonobo cdr crypt cups dga directfb dvd emacs encode esd evo fam fbcon foomaticdb freetype freetype2 gb gd gdbm gif gnome gpm gtk gtk2 gtkhtml imap imlib ipv6 java jpeg junit kde lame lcms ldap libg++ libwww mad mikmod mmx motif mozilla mpeg mysql ncurses nls ogg oggvorbis opengl oss pam pda pdflib perl plotutils png python qt quicktime readline samba sasl sdl slang slp spell sse ssl tcltk tcpd tetex tiff truetype video_cards_radeon vorbis x86 xml xml2 xmms xv zeo zlib"
Well, maybe it can look, but if the device isn't present, it should keep going gracefully rather than hang with dumb look on its face :)
What version of hotplug are you using? What do you mean "SYSFS key"? And what is causing the hang? What device?
What version of hotplug are you using? - the latest hotplug/hotplug-base 20040401 What do you mean "SYSFS key"? - Hotplug and udev work together; udev requires custom rules for both known and unknown devices to have a sane set of device nodes no matter which devices happen to be attached. Thus, a rule for my SD card reader to create the right stuff in /dev: BUS="usb", SYSFS{product}="IC1110 V1.0A", NAME{all_partitions}="mmc/mmc%n" This is the one I settled on after trying various rules (there are more ways to skin a device node than Schrodinger's cat...) since the product ID seems to be the best way to identify a given device. I also added the following rule for a CF card reader that's always plugged in: BUS="usb", SYSFS{product}="CF Media-Shuttle", NAME{all_partitions}="cf/cf%n" which works as expected, since the device is always present when hotplug starts. The same is true for my cdrw/dvd combo IDE drive: BUS="scsi", KERNEL="sr*", NAME="cdroms/cdrom%k", SYMLINK="cdrom%n cdrw dvd" I guess I could use ATAPI for the above, but the legacy config seems to work okay. If I leave the first rule above in the udev.rules file, the machine starts to hang at boot time as described in the original bug report (if the device is not connected). And what is causing the hang? What device? - See above. Maybe I'm just a simpleton, but it seems to me that a graceful failure is required for a missing usb device. There many ways to reference a device, but I can't see a more appropriate way than via the usb bus identifier and the vendor/product stuff. Any insight would be appreciated...
Ok, you are getting udev and the hotplug scripts mixed up here. They really have nothing to do with each other (with the exception that udev needs hotplug-base to work properly, but that's a very minor issue.) If the kernel is dieing because it can't start up or shut down your usb devices, then that is a kernel issue. There were a number of usb shutdown issues with the 2.6.4 and a few in the 2.6.5 kernel. You can either use the 2.6.5 kernel, which does fix a number of these issues, or I'd really recommend using the 2.6.5-mm kernel, or wait till the next 2.6.6-rc kernel (hopefully the usb fixes get into there in time...)
I wasn't "mixing them up" but the hotplug scripts are triggering this behavior. Not having the knowledge or time to debug all the hotplug stuff, I was hoping there might be a way to make it a little more graceful. Oh well...
I suggest not having the hotplug init script run at all. Make sure any usb controller driver is loaded in the modules autoload section instead. That will solve the shutdown problem.
Well, as it turns out, it's not a complete hang (although it seems to stop responding to everything, including keyboard input). It appears to be more of a long timeout of some kind, since if I wait long enough (5 - 10 minutes or so) it will continue and boot up normally. It's funny that commenting out my USB key above seems to help, since it actually appears to hit the timeout on Starting PCI hotplugging... Well, again, I don't have either the knowledge or the time to track this down, however, it seems like all the hotplug startup stuff could be a bit less wonky.