:: Re: [Dng] vdev status updates
Góra strony
Delete this message
Reply to this message
Autor: Steve Litt
Data:  
Dla: dng
Temat: Re: [Dng] vdev status updates
On Tue, 17 Mar 2015 04:48:46 -0400
Jude Nelson <judecn@???> wrote:

> > How would that "watching" work?
>
> vdevd-user would have an inotify(2)-based back-end (hopefully via
> libkqueue, so it would be portable). The back-end would set up
> inotify watches on /dev and its descendant directories, and translate
> creat(2) and unlink(2) events from inotify into a vdev-specific
> device event with the relevant information (e.g. by querying the
> device metadata that the system's vdevd puts into /dev/vdev/...).
>
> -Jude


Several months ago I did a proof of concept shellscript using
inotifywait, which detected USB thumb drive insertion and removal. It
worked just fine, and if I'd wanted to spend more than 30 minutes, a
combination of tweaking sudoers and writing a few shellscripts could
have given instant mounting of thumb drives (and probably DVDs).

I understand that FreeBSD has kqueue and kevent, which apparently do
some of the same things. According to
http://en.wikipedia.org/wiki/Kqueue , it's available in all the major
BSDs. So your idea sounds doable, always assuming you can make a high
level interface that calls either inotify or kqueue.


SteveT

Steve Litt                *  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance