Subject: How can I detect USB device insertion/removal?
To: None <current-users@NetBSD.org>
From: Scott Ellis <scotte@warped.com>
List: current-users
Date: 07/10/2006 14:50:11
I'm trying to automate my backup solution, and am at a point of 
inelegance.  I have a serial controlled power-strip which connects a 
handful of external USB hard-drives.  When I command the power-strip to 
turn on a particular drive, NetBSD sees the drive just fine (umass->sd1, 
  etc.).

My issue is, how can I programatically (or with a script) detect that 
the new sd1 is connected (so I can mount it, kick off the backup, etc.)? 
  Ideally, there'd be some event that gets fired when a device is 
attached/detached that I could look for, rather than just polling 
syslog. :-)

There was some work done by Jachym Holecek back in 2005 which 
implemented a "devd" type interface, but I can't find anything that's in 
-current which looks equivalent.

Am I SOL, or just clueless and not seeing how this can be easily done?

	ScottE