Debian – How to create a fake inotify event on debian

debianinotify

I have a dedicated box running minidlna on Debian sourcing media files from a shared cifs drive.

When I add a new file to the share not using the midia box, minidlna does not recognize the new files as an inotify event is not created.

I found a workaround to make it recognize new files running touch from the media box from time to time but it does not work for folders as minidlna only identify IN_CREATE & IN_MOVED_TO events for folders and touch does not create these events for folders.

So I'd like to know if there is any other way to create this "fake" events or if you know how can I have one of these events for a folder without having to move it.

Best Answer

What happens if you mount -o remount the CIFS filesystem?

This sounds like it is a bug in the CIFS implementation, in that directories are not triggering the notify events correctly.

I could find no references regarding event injection into an existing inotify stream. I suppose it could be done using SystemTap, but that's not practical. A better solution is to file a bug report on ReadyMedia (current name for the project at SourceForge.net).

I had a quick look at the code for notify.c at SF.net and it looks good, but just 30 seconds made it clear there was a memory leak in the code that adds/removes watches. :( However, it looks like modifying the code to properly support notify on directories wouldn't be tough.

Related Question