Comment 9 for bug 1430068

Revision history for this message
Max Mustermann (loremipsumbuntu) wrote :

executing

> sudo echo 512 > /proc/sys/fs/inotify/max_user_instances

does not work because it won't open the file as root but as your current user. This is because "> /proc/sys/fs/inotify/max_user_instances" is not part of what sudo executes. The command is interpreted by your shell as follows: open the file "/proc/sys/fs/inotify/max_user_instances
" for writing and execute the programm "sudo" with the following arguments ["echo", "512"] and replace the output(stdout) of the program with said file for starting it. Since your shell is not running as root, it cannot open "/proc/sys/fs/inotify/max_user_instances" for writing.

You can either get a shell running as root (with "sudo -i" for example), or do "echo 512 | sudo tee /proc/sys/fs/inotify/max_user_instances". The 2nd way works by passing the output of echo to sudo with in turn will pass it on to tee which then will open the file, which it can do because sudo invoked tee as root.