seb-m / pyinotify

Monitoring filesystems events with inotify on Linux.
http://github.com/seb-m/pyinotify/wiki
MIT License
2.29k stars 379 forks source link

Ignore SIGCHLD to avoid generating zombie process #113

Open ymattw opened 8 years ago

ymattw commented 8 years ago

This fixes #112. We do not care about the exit status from child process anyway.

Verified with python 2.7.5.

% ./python2/pyinotify.py -e IN_MODIFY -f /tmp/input.log -c 'sleep 1' & sleep 2; echo hello > /tmp/input.log
[1] 30251
<Event dir=False mask=0x2 maskname=IN_MODIFY name='' path=/tmp/input.log pathname=/tmp/input.log wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name='' path=/tmp/input.log pathname=/tmp/input.log wd=1 >

% pgrep -lf defunct
[no output]