iNotify doesn't appear to be working in my DS1819+

Currently reading
iNotify doesn't appear to be working in my DS1819+

26
0
NAS
DS1819+
I'm running an Emby server from my NAS, and the real-time monitoring of my media libraries isn't working; it doesn't pick up when I add or remove files and I have to manually run a scan from the Emby app.


It doesn't appear to be an Emby-specific issue, as iNotify doesn't seem to notice that I've made the changes and therefore Emby is never alerted. Someone on the Emby forum had me run inotifywait -rm on the folder my media is stored in, and when I add or remove files while I can see some changes to the output, there's nothing specific to a file. Just lots of opening and closing folders.
 
Last edited:
Do you happen to have a large library? The default value for inotify file watches is 8196 files, which if you have plenty of mp3 files in a folder or many tv shows is quickly exhausted.

I had the same "problem" with plex.

You need to modify the file /etc/sysctl.conf (as root) and change the value for fs.inotify.max_user_watches to a higher value than 8196. I have a rather large library and my setting is fs.inotify.max_user_watches=256000.
Once the configuration is changed, run sudo sysctl -p to apply the change.
 
Upvote 0
It is unclear to me, If you increased the value before and still expierenced the problem, or you increased it just now...

If should just work fine, and even propagate the inotify events to containerized apps.
 
Upvote 0
26
0
NAS
DS1819+
Increased previously. It was one of the first troubleshooting steps proposed over on the Emby forums. Emby isn't throwing any "you have too many inotify things" errors, it's just not doing anything at all. inotifywait shows nothing file-specific when files are added.
 
Upvote 0
Plex at least indicates in the logs that it fails to register further inotifywatches - though it doesn't tell you the reason either.

Inotify only works localy, the notification is not propated to remote shares. For instance if you add a file to a folder on your nas, but emby is on a different computer (baremetal, vm or container on a different host) that uses a remote share to access the nas folder, the inotify event will not be propagate to the other computer.
 
Upvote 0
26
0
NAS
DS1819+
Emby is installed to the NAS.

And regardless, I should see inotify activity if I run inotifywait while adding a file, right? Whether Emby is installed there or not.
 
Upvote 0
inotify itself is unrelated to Emby or Plex, they simply leverage the inotify notifcation system.

If Emby is directly on the NAS: it should be able to fetch the events - plex does!
If Emby is on a remote maschine: how should it be able to fetc events that are not propagated over remote share protocols?

You can actualy install a synyocommuity package and test inotify functionality yourself.
 
Upvote 0
26
0
NAS
DS1819+
inotify is a DSM thing, not an Emby thing, so it should appear in inotifywait whether Emby is installed or not.

But it doesn't. So something is wrong on the DSM level.
 
Upvote 0
Replace the source folder with what you need, paste the script into a shell and add a file to the folder.
Code:
source=/volume1/docker
inotifywait -m /${source} |
    while read path action file; do
        echo "New file '$file' in directory '$path' via action: '$action'"
    done
You should see the notifications on the screen then.
 
Upvote 0
26
0
NAS
DS1819+
"Paste the script into a shell"? You mean run it with something like PuTTY?

Do I need that to reference the exact folder, or will a parent folder do?

Where on the screen should I see notifications?

Isn't that just doing the same thing running inotifywait -rm on the folder and manually looking at the output?
-- post merged: --

Here's a post from the Emby forums where I go over what the inotifywait output is when I add a file: https://emby.media/community/index....s-broken/page/13/&tab=comments#comment-941921
 
Upvote 0
I have no permission to see the emby forum.

Any ssh client will do, putty will be job just fine.
You can run it with any folder - just make sure you have a way to add/modify a file on that location, because the snippet will loop thru the registered watch, it will be blocked until an event is triggered - you will need to quit it with ctrl+c once you are done.

Your command with -r will act recursivly, which will take longer to register the inotifywatches for all folders and files in the folder and all its subfolders.
 
Upvote 0
26
0
NAS
DS1819+
Well that's weird, I don't know why you'd need permission to read a thread. I've attached the screenshot, anyhow.

I'm unable to run your script as the file path has a space in it: /volume1/Emby Libriaries/Stubs/

If I try "/volume1/Emby Libraries/Stubs/" it gives me an error saying that Libraries/Stubs/ doesn't exist. If I try /volume1/Emby\ Libraries/Stubs/ it gives me the same error.
 

Attachments

  • Screenshot 2020-10-28 11.51.53.png
    Screenshot 2020-10-28 11.51.53.png
    33 KB · Views: 4
Upvote 0
26
0
NAS
DS1819+
Code:
[email protected]:/$ source=/volume1/Emby\ Libraries/Stubs/
[email protected]:/$ inotifywait -m /${source} |
>     while read path action file; do
>         echo "New file '$file' in directory '$path' via action: '$action'"
>     done
Setting up watches.
Couldn't watch Libraries/Stubs/: No such file or directory
 
Upvote 0
Hmm, odd. Then quote it :) source="/..." without escaping the space character with a backslash.

Anyway, your screenshot indicates that inotify itself is triggering inotify events.
 
Upvote 0

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Top