# Replacement for wait_on in 9.1?



## JoeSchmuck (Aug 11, 2013)

In FreeNAS 8.3.1 (based on FreeBSD 8) I am using wait_on to monitor for changes to specific hard drive areas.  My question is:  In FreeBSD 9.1 is there any replacement that does basically the same thing?

It's not that I don't like wait_on, but if there is something else out there, it might give me some other options to work with.

So what I've been doing is using MiniDLNA but the problem is, it will not rescan the designated database (let's say Movies) if there is an addition or deletion.  I've been using a small script using wait_on to scan the area and if there is a change to restart MiniDLNA.

So I'm looking for other options since I will be moving over to FreeNAS 9.1 (based on FreeBSD 9.1) here shortly.  I plan to test in a VM of course.

TIA,
Joe


----------



## ta0kira (Aug 17, 2013)

If you know even a little C, kevent is pretty easy to work with.

Kevin Barry


----------



## JoeSchmuck (Aug 18, 2013)

Unfortunately I haven't programmed in C in about 25 years, or at least it feels that long ago.  I'm thinking about working the MiniDLNA code to include kqueue but it's likely over my head.  I'd rather not restart MiniDLNA just to rescan the database.


----------



## ta0kira (Aug 19, 2013)

I looked over the MiniDLNA code briefly, and I think you'd need to rewrite the functions in inotify.c with kevent calls. The good news is that the code is already set up to take filesystem changes into account.

Kevin Barry


----------



## JoeSchmuck (Aug 20, 2013)

Thanks for that input, glad you sound so optimistic about it and if you wanted to save me the time I'm perfectly happy to let you jump in and do it for me. I'm sure it would take you about an hour to incorporate and fully test it out  I did take a shot at libinotify port but it didn't work under a ZFS file system, but I'm not saying it is the ZFS file system causing the problem. The libinotify doesn't cover a few key items but I thought it worth a shot.

Nope, I'll get around to it eventually but I'd have to say it really couldn't be that easy since no one has modified the port yet and MiniDLNA has been ported to FreeBSD for a very long time now. I was going to take a good look at the wait_on code to see how it works because you want to look for changes in only the directories specified and possibly have it recursive which is how I really want it done. I try to take into account all options that a user might desire (within reason) and make it a user friendly program.

I'm headed on vacation in two days for about two weeks. It will be nice to get away and just relax.

Again, I do appreciate your insight to the code and I will have to give it a look in a few weeks.  But if you make any progress, let me know (just teasing a little bit, kind of)

-Joe


----------

