# inotifywait times out immediately

**URL:** <https://forums.suse.com/t/inotifywait-times-out-immediately/40677>\
**Category:** SLED Applications\
**Created:** [May 15, 2023, 2:52pm UTC](https://forums.suse.com/t/inotifywait-times-out-immediately/40677 "2023-05-15T14:52:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suhas\_B.K](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/suhas_b.k/32/10180_2.png) [@Suhas\_B.K](https://forums.suse.com/u/Suhas_B.K)\
**Post date:** [May 15, 2023, 2:52pm UTC](https://forums.suse.com/t/inotifywait-times-out-immediately/40677/1 "2023-05-15T14:52:28Z")

</div>

**Describe the bug**

I’ve been using inotifywait to watch directories on SLES15 SP3. When I launch inotifywait (even with the -r flag), it says “Watches established” and then exits with exit code 2 without reporting an event.

**To Reproduce**  
Steps to reproduce the behavior:

From command line, run inotifywait -r -e close\_write /home/suhas/testdir  
Observe that after setting up watches, the process immediately exits:  
Setting up watches. Beware: since -r was given, this may take a while! Watches established.  
Check the exit code with echo $?  
Observe response of 2.  
Expected behavior  
Inotifywait should wait indefinitely for an event.

**Desktop (please complete the following information):**

OS: SLES15 SP3  
Version: 3.14 (via suse repository)  
Additional context  
This behavior was not happening until today. I just tried restarting the service but that didn’t make a difference.
