Skip to content

Infinite loop when invoke "ls -la" in watched directory #8

Open
@jlegido

Description

@jlegido

Not sure if it's a bug or not, but just in case let me provide details:

  1. Get watcher (I downloaded it 09/05/2015)
cd /tmp; git clone https://github.com/splitbrain/Watcher
  1. Create below .ini file:
sudo vim /etc/watcher.ini
[DEFAULT]
logfile=/tmp/watcher.log
pidfile=/tmp/watcher.pid
[job1]
; directory or file to watch.  Probably should be abs path.
watch=/tmp/test
events=close
excluded=
recursive=true
autoadd=true
command=ls -l $filename
  1. Create watched dir:
mkdir /tmp/test
  1. Start the daemon and tail life the logs:
cd /tmp/Watcher; ./watcher.py start
tail -F /tmp/watcher.log
  1. Go to the watcher directory and issue a "ls -la" command:
cd /tmp/test; ls -la

Expected behaviour The log shows nothing, since no file was closed (maybe I'm wrong in this assumption...)
Found behaviour The daemon starts writing the log without stopping:

Close nowrite:  /tmp/test
Close nowrite:  /tmp/test
Close nowrite:  /tmp/test
Close nowrite:  /tmp/test
Close nowrite:  /tmp/test
Close nowrite:  /tmp/test
Close nowrite:  /tmp/test
Close nowrite:  /tmp/test
Close nowrite:  /tmp/test
Close nowrite:  /tmp/test
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0
total 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions