On Wed, 11 Mar 2009 07:42:04 -0700 (PDT), Peter Steele <pste...@maxiscale.com> wrote: > I want to have a process running on my FreeBSD box that > automatically detects when a USB drive is inserted. What's > the easiest way to accomplish this? I know I could simply > monitor /var/log/messages and look for the appropriate > events to appear, but is there a more elegant way?
The system will monitor it itself. :-) My question to you would be: What exactly do you mean by "automatically detect"? The drive *is* automatically detected. Should it be mounted afterwards? The creation of the device files (after system startup) is controlled by the file /etc/devfs.rules. You can use automounters to automatically mount devices when they appear. In order how to determine file systems, slices and partitions on such an USB device, you could, for example, have a look at how FreeSBIE does it. Additionally, there are already tools integrated in KDE and Gnome that automount USB devices. -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... _______________________________________________ firstname.lastname@example.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"