inotifyd problems
Denys Vlasenko
vda.linux at googlemail.com
Mon Nov 17 22:11:52 UTC 2008
On Monday 17 November 2008 18:18, Piotr Grudzinski wrote:
> Will try it later.
> But, with this solution, it seems that my handler is left waiting for events
> after it was told not to expect any anymore.
You can specify file:MD in order to catch "Delete" event.
I just checked: if I do "mv other_file file", you do get
a D event.
Agent process can then terminate inotifyd by killing its
parent process. In shell, it would be
kill $PPID
However, we probably better add handling for these:
#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
#define IN_IGNORED 0x00008000 /* File was ignored */
or at least for IN_UNMOUNT and IN_IGNORED. (IN_IGNORED's
comment is wrong. It means that file is no longer watched.)
This happens when file is deleted or "deleted by move",
and I suspect it's a better way to catch all other
weird ways inode can disappear by watching specifically
for IN_IGNORED, not for IN_DELETE_SELF (0x00000400).
Since watching after IN_IGNORED is pointless, exiting after this
might be useful for largish group of users.
Do we need to provide an option for this?
--
vda
More information about the busybox
mailing list