Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Detect Plugged USB Flash Drive / CD in CDROM Drive

by zentara (Archbishop)
on Nov 27, 2008 at 12:39 UTC ( [id://726396]=note: print w/replies, xml ) Need Help??


in reply to Detect Plugged USB Flash Drive / CD in CDROM Drive

I think you should google for "linux automount", set it up to run the automounter daemon, then you probably run a timer to check /etc/mtab. Or even more manually, you can tail /var/log/messages for the various messages.

There is a difference in approach for detecting a cd insertion and a usb drive plugin. The cd would have to be mounted, (unless the situation is a usb cdrom drive getting plugged in). So you need to decide: do you want to look for actual mounts, or just the usb subsystem detecting an additional device, or both? Ubuntu does a good job of detection, maybe you should set it up and check out what it does?


I'm not really a human, but I play one on earth Remember How Lucky You Are

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://726396]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-03-29 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found