# net/minidlna: newly added files?



## zirias@ (Mar 1, 2021)

I use net/minidlna to serve media files to my TV set, with a single `media_dir` containing symlinks to a few folders that actually contain the files. Option `inotify=yes` is set.

Now, when adding new files, *sometimes* it works as expected, but most of the time, I need to restart the service with

```
service minidlna stop
service minidlna rescan
```
in order to pick up the new files.

Now, I see "inotify" is a Linux-specific API and running on FreeBSD, you need some other solution. Does anyone know whether this is handled in net/minidlna, and if so, is there something I need to configure to make this work reliably?


----------



## SirDice (Mar 1, 2021)

The port doesn't depend on devel/libinotify, so I suspect it doesn't use it. As the source code has a kqueue.c file it looks like it uses kqueue(2) on FreeBSD.









						GitHub - glebius/minidlna: Mirror of git.code.sf.net/u/glebius/minidlna, a fork of git.code.sf.net/p/minidlna/git
					

Mirror of git.code.sf.net/u/glebius/minidlna, a fork of git.code.sf.net/p/minidlna/git - GitHub - glebius/minidlna: Mirror of git.code.sf.net/u/glebius/minidlna, a fork of git.code.sf.net/p/minidln...




					github.com


----------



## zirias@ (Mar 1, 2021)

IOW, it should work "natively". Then, what am I missing? 
I can post my minidlna.conf if it helps, but didn't change anything relevant from the default/example one delivered by the port…

edit: side note, nice to see there's a compatibility shim, didn't even know about devel/libinotify so far


----------



## SirDice (Mar 1, 2021)

Zirias said:


> IOW, it should work "natively". Then, what am I missing?


Maybe it does need a switch, similar to `inotify=yes` but for kqueue(2) to "turn on". I didn't look too deeply into it. 



Zirias said:


> side note, nice to see there's a compatibility shim, didn't even know about devel/libinotify so far


Yes, it's been available for a while. Specifically for ports that require `inotify`, there seems to be quite a few of them.


----------



## zirias@ (Mar 1, 2021)

Thanks, will have another look and maybe dive into the code myself. Would still be nice if someone using this port might have a quick answer


----------



## roddierod (Mar 1, 2021)

I use this port and I have the same issue, but I don't think it is FreeBSD specific because if you look around other people on various Linux report the same.  I just restart the service when I add new files.  I was using minimserver before this and it required restart when adding file to, so I just became used to it.


----------

