Skip to content

Instantly share code, notes, and snippets.

@tbjgolden
Last active November 27, 2024 14:22

Revisions

  1. tbjgolden revised this gist Apr 2, 2022. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions inotify-instructions.md
    Original file line number Diff line number Diff line change
    @@ -14,16 +14,16 @@ ls /etc/sysctl.d/*-max_user_watches.conf
    ## a) If no output

    ```sh
    echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
    echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max_user_watches.conf && sudo sysctl --system
    ```

    ## b) If the command outputs a file

    _(in the rare case where it outputs multiple files, continue using the **last** one in the list)_

    ```sh
    # replace `/etc/sysctl.d/50-max-user-watches.conf` with the file returned from the previous `ls` command
    echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/50-max-user-watches.conf && sudo sysctl --system
    # replace `/etc/sysctl.d/50-max_user_watches.conf` with the file returned from the previous `ls` command
    echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/50-max_user_watches.conf && sudo sysctl --system
    ```

    # Check it's working
  2. tbjgolden created this gist Oct 12, 2020.
    41 changes: 41 additions & 0 deletions inotify-instructions.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    To avoid this error, we need to _increase the inotify watcher limit_.

    The way to do this is different on Arch based distributions than other Linux distributions.

    # Instructions for Arch Linux/Manjaro

    Check for an already existing inotify config file
    (recent versions of Manjaro include one)

    ```sh
    ls /etc/sysctl.d/*-max_user_watches.conf
    ```

    ## a) If no output

    ```sh
    echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
    ```

    ## b) If the command outputs a file

    _(in the rare case where it outputs multiple files, continue using the **last** one in the list)_

    ```sh
    # replace `/etc/sysctl.d/50-max-user-watches.conf` with the file returned from the previous `ls` command
    echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/50-max-user-watches.conf && sudo sysctl --system
    ```

    # Check it's working

    ```sh
    cat /proc/sys/fs/inotify/max_user_watches
    ```

    Expected output: `524288`

    # Credits

    * [inotify og dev](http://johnmccutchan.com/)
    * [explanation and **_troubleshooting_**](https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers)
    * [manjaro fix original](https://github.com/guard/listen/issues/444)