Setting fs.inotify.max_user_watches values - Keeps resetting

Questions and mods regarding system management may go here
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/support_form.php?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
stevieboy
I'm New!
I'm New!
Posts: 9
Joined: Mon Jul 20, 2015 7:24 pm

Setting fs.inotify.max_user_watches values - Keeps resetting

Postby stevieboy » Sat Aug 06, 2016 7:09 pm

Hi,

I am running Crashplan in a docker contatiner on a DS1815+ and noticed with wasn't seeing file changes in real time - When i checked the file watch setting with cat /proc/sys/fs/inotify/max_user_watches it was showing as 8192 which is very low. I set it to a higher value by adding the following line to /etc/sysctl.conf:

fs.inotify.max_user_watches=1048576

If I then run sudo sysctl -p /etc/sysctl.conf then the value is set and all works well. However on a reboot it gets set back to 8192 (the file still shows fs.inotify.max_user_watches=1048576)

Can anyone think how I get this value to stick upon a reboot?

Cheers
davidhbrown
Trainee
Trainee
Posts: 18
Joined: Fri Jul 02, 2010 4:42 pm

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Postby davidhbrown » Thu Aug 25, 2016 5:09 pm

stevieboy wrote:Can anyone think how I get this value to stick upon a reboot?

Just thought I'd chime in that I'm having this issue with trying to use the GoodSync server on a DS916+ (8G), too.

I saw some references in the man page for sysctl that
Please note that modules loaded after sysctl is run may override the settings (example: sunrpc.* settings are overridden when the sunrpc module is loaded). This may cause some confusion during boot when the settings in sysctl.conf may be overriden. To prevent such a situation, sysctl must be run after the particular module is loaded (e.g., from /etc/rc.d/rc.local or by using the install directive in modprobe.conf)


So, I tried grep sysctl /etc/rc* and saw a few uses but not to change anything in fs.inotify.* There is no modprobe.conf. Seems like packages such as Cloud Station Server, Cloud Station ShareSync, CloudSync, and Hyper Backup would be more likely to use this function and so set the parameter. Maybe Media Server? I've poked around some in /volume1/@appstore/<PackageName>/etc without finding anything suspicious yet. Clues welcome :-)
Current: DS916+ (8GB); Previous: DS410, Buffalo TeraStation. Client OS: Mostly Windows.
stevieboy
I'm New!
I'm New!
Posts: 9
Joined: Mon Jul 20, 2015 7:24 pm

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Postby stevieboy » Fri Dec 30, 2016 12:28 pm

Hi,

In the end I set up tasks in the task scheduler - One to be run on reboot and the other at 9am every day that simply runs "sysctl fs.inotify.max_user_watches=1048576" as root. Problem solved.

Cheers
Steve
adardia
I'm New!
I'm New!
Posts: 1
Joined: Sat Mar 25, 2017 6:29 pm

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Postby adardia » Sat Mar 25, 2017 6:31 pm

I've had the same problem w/ it not sticking after a reboot. Thanks for the tip on using a Task Scheduler reboot item to prepare it.

Do you know if its guaranteed that it always runs before the Docker daemon boots up and starts the containers?
QWEbie
Trainee
Trainee
Posts: 14
Joined: Sat Jun 10, 2017 11:02 am

Re: Setting fs.inotify.max_user_watches values - Keeps resetting

Postby QWEbie » Tue Nov 07, 2017 3:59 pm

stevieboy wrote:Hi,

In the end I set up tasks in the task scheduler - One to be run on reboot and the other at 9am every day that simply runs "sysctl fs.inotify.max_user_watches=1048576" as root. Problem solved.

Cheers
Steve


Thanks stevieboy! I scheduled it for daily every hour~ How do you set it to run after every reboot??

Was running jrcs/crashplan docker container, but after DSM upgrade to DSM 6.1.4-15217, not only did the Docker app cleared my crashplan settings, after re-creating the docker container, I can't seem to login into Crashplan servers, although nothing has changed on my firewall settings. :shock: :cry:

Moved over to jlesage/crashplan-pro and was able to login! But came into the inotify error. :| Fingers crossed, now waiting for block synchronization to finish after adapting into the old GUID.

For anyone who comes across missing/blank files/folders on the Syno, please add the USER_ID and GROUP_ID as per instructions from jlesage docker page. :D
DS 916+ | x2 4TB WD Red WD40EFRX 5400rpm
DS 916+ | x4 4TB HGST HDN726040 7200rpm
DS 413j

Return to “System Managment Mods”

Who is online

Users browsing this forum: No registered users and 4 guests