Opened 8 years ago

Last modified 4 years ago

#7094 assigned defect

System does not wait until USB subsystem settles before continuing with boot process

Reported by: W. Michael Petullo <mike@…> Owned by: thepeople
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:


I am using the new USB block hotplug scripts in order to mount a USB disk before mt-daapd runs. Mt-daapd is configured so that its media library is on the USB disk. I am finding that the USB subsystem does not finish initializing before the mt-daapd init script runs (even though the usb script runs before the mt-daapd script). The relevant scripts are run with the following priorities:


It takes several seconds before the kernel identifies sda2:

Jan 1 00:00:21 golem user.notice kernel: scsi 0:0:0:0: Direct-Access Seagat
Jan 1 00:00:21 golem user.notice kernel: sd 0:0:0:0: [sda] 976773168 512-byte l
Jan 1 00:00:21 golem user.notice kernel: sd 0:0:0:0: [sda] Write Protect is off
Jan 1 00:00:21 golem user.debug kernel: sd 0:0:0:0: [sda] Mode Sense: 1c 00 00
Jan 1 00:00:21 golem user.err kernel: sd 0:0:0:0: [sda] Assuming drive cache: w
Jan 1 00:00:21 golem user.debug kernel: usb-storage: device scan complete

When I read documentation for booting from a USB disk, I often find that users add a sleep command after running hotplug2 and mounting the usbfs. Should we add this to one of the init scripts? Adding a "sleep 5" to the end of the start function in S39usb works for me.

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by thepeople

  • Owner changed from developers to thepeople
  • Status changed from new to assigned

comment:2 Changed 8 years ago by Daniel Dickinson <cshore@…>

sleep X is actually a bit of a hack...hotplug is actually asynchronous, so it doesnt have a guaranteed time or order of execution. The real solution (until we have dependency/event-based init) is to add a hotplug script so /etc/hotplug.d/block/90-mt-daap that checks if the device being added is the device you need, and launching mt-daap from that script (e.g. make boot() and empty function it /etc/init.d/mt-daap and in 90-mt-daap have

if [ $our_device = "true" ]; then
   /etc/init.d/mt-daap start

where our_device is set by the test for this being the right block device

comment:3 Changed 8 years ago by W. Michael Petullo <mike@…>

Daniel's solution should work for the near term.

See also the mail thread at

comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

as assigned .

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.