Due to tons of variations of Linux environment recently introduced native file system watcher for Linux may refuse to function properly. Here are some simple steps which may help to track down a problem.
Update
Make sure you are using the latest versions (download them from Git repository), they are named fsnotifier and fsnotifier64, placed into bin/ directory of IDEA, and granted execution rights.
Self-test
Execute watcher in self-diagnostics mode:
It should print something like this:
Examine its output for any errors or warnings.
Warning: fsnotifier will try to setup a watch for directory tree starting from current directory – if hierarchy is deep, there will be lots of output.
Activate logging
The next step is to activate logging for watcher and see what's happening in real.
Watcher utilizes "user" facility of syslog(3) – messages usually can be found in /var/log/user.log. Verbosity is regulated via FSNOTIFIER_LOG_LEVEL environment variable, possible values are: debug, info, warning, error, off.
By default logging is switched off. To activate it set FSNOTIFIER_LOG_LEVEL to appropriate value before starting IDEA, e.g.:
Warning: "debug" verbosity level may produce really huge amount of messages – use with care.
If you see something suspicious in logs please feel free to post it here as comment (or via attachment if your log is long enough).

8 Comments
Siddharth Priya
Does fsnotify start watching directories with root as the directory from where it was started?
Roman Shevchenko
No. It communicates with IDEA and watches directories IDEA asked him to watch.
Anonymous
thanks...
Which directories does IDEA give it? Only the directories under Content roots?
Roman Shevchenko
Project roots, SDKs and libraries, IDEA config directories. It is also used by file choosers.
Anonymous
I have problem with fsnotifier on Ubuntu 16.04 x64. Selft test result is exactly the same as in example above but when I start ii in normal mode and chreate/modify/delete file in watched directory I dont see any result on stdout.
Roman Shevchenko
Either the filesystem is incapable of producing notifications, or there are symlinks in paths being watched/modified.
Anonymous
... so is it by design that you not support symlinks? I spent several hours wondering why Typescript code was not getting compiled on change before I worked out the reason was fsnotifier not supporting symlinks and then finding the related ticket IDEA-65174 that has been open for 6 years.
It seems the source (https://github.com/JetBrains/intellij-community/tree/master/native/fsNotifier/linux) was last modified only 8 months ago. So, is it the case that there is no solution for symlinks and we should take that into account on mission-critical projects when choosing our development tools, or is it just that nobody has had a look into this yet?
Roman Shevchenko
It is a natural limitation - changes happen to real files. Path mapping should be implemented on the IDE side.
Add Comment