:: Re: [Dng] vdev status updates
Página Inicial
Delete this message
Reply to this message
Autor: Jude Nelson
Data:  
Para: Steve Litt
CC: dng@lists.dyne.org
Assunto: Re: [Dng] vdev status updates
Hi Steve,

> 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).


That's basically what vdevd-user would do. The only difference between
using inotifywait is that the user would be able to transfer his/her
knowledge of setting up vdevd to setting up vdevd-user (since they use the
same config file format). Of course, the choice is entirely the
user's--vdevd-user would be only one of many approaches to running
unprivileged code in response to a device appearing or disappearing :)

> 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.


It's already done by libkqueue: https://github.com/mheily/libkqueue.
vdevd-user would just link against libkqueue.

-Jude

On Tue, Mar 17, 2015 at 10:16 AM, Steve Litt <slitt@???>
wrote:

> 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

>
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
>