pyinotify issue

AndreH ahaupt at gmail.com
Tue Jun 17 06:11:06 EDT 2008


On Jun 13, 3:39 pm, AndreH <aha... at gmail.com> wrote:
> Good day,
>
> I just installed pyinotify on my gentoo box.
>
> When I test the library through "pyinotify.pv -v /tmp" under root,
> everything works great, but when I try the same thing under my local
> user account, I receive the following error:
> Error: cannot watch . (WD=-1)
>
> Not very helpful. I've tried VERBOSE=True mode, but it doens't provide
> any additional information.
>
> I also tried it for a directory in my home folder just to be sure it's
> not a permission problem, but no luck.
>
> Any ideas?
>
> Regards,
> Andre

Ok I ended up solving my problem.

pyinotify is just a wrapper for the c lib, inotif.h. Installing the
inotify-tools package allows one to do better troubleshooting.

First, my kernel version was too old and did not allow inotify to be
executed at user-level. I bumped my kernel up to 2.6.24 and enabled
the user-level execution flag.

Then pyinotify worked once and failed for all consecutive retries.
inotifwatch said that my "maximum number of user watches" was maxed
out and that I should increase it under /proc/sys/fs/inotify/
max_user_watches.

Something must be wrong, since the max_user_watches was set to 8192. I
played around with this setting (sysctl -w
fs.inotify.max_user_watches=16843), pyinotify.py and inotifywatch, and
finally came the conclusion that pyinotify 0.7.0 was buggy. I got hold
of 0.7.1 which seems to have fixed this problem. Hopefully, I'm not
speaking too soon.



More information about the Python-list mailing list