Permission denied for root to change inotify max_user_watches, how solve this?

9,724

I found the answer.

This server is a VPS and it is running in a OpenVZ container and I'm not allowed to modify any kernel parameter of that container.

Share:
9,724

Related videos on Youtube

Samuel G. P.
Author by

Samuel G. P.

I'm a web developer with knowledge in html, css, javascript, ruby, rails, php, zend framework, drupal, linux, apache, nginx, mysql and postgresql. And i love, really love, rails ;D

Updated on September 18, 2022

Comments

  • Samuel G. P.
    Samuel G. P. over 1 year

    As root in a CentOs 6.4 server I got this error in an application:

    Fri May 16 01:45:23 2014 Error: Terminating since out of inotify watches.
    Consider increasing /proc/sys/fs/inotify/max_user_watches
    

    But when I try to run the command as root I got permission denied.

    # echo 100000 > /proc/sys/fs/inotify/max_user_watches
    -bash: /proc/sys/fs/inotify/max_user_watches: Permission denied
    

    Even if I edit the /etc/sysctl.conf I get permission denied:

    # echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf
    # sysctl -p
    error: permission denied on key 'fs.inotify.max_user_watches
    

    How can I solve this?

  • BlackCow
    BlackCow almost 9 years
    Ok, me too. So how do you fix it?
  • kasperd
    kasperd about 8 years
    The question explicitly mentioned that he go the error message while running as root.
  • Mariano Argañaraz
    Mariano Argañaraz about 8 years
    Updated my answer, since it doesn't matter if you are root, I have experienced this issue.