Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed Watcher this way: both watcher.py and watcher.ini are located in /etc I also installed pyinotify and it does work when I use python -m pyinotify -v /var/www

However, I want to use the daemon and when I start watcher.py, I get weird lines on my watcher.log (see below). I also included my watcher.ini file.

Note: I have the latest version of Python. The watcher.py can be found here

What is wrong with what I did? Also, do I really need pyinotify? Thanks a lot for your help

watcher.ini:

[DEFAULT]
logfile=/var/log/watcher.log
pidfile=/var/run/watcher.pid

[job1]
watch=/var/www
events=create,delete,modify
recursive=true
command=mkdir /home/mockfolder ## just using this as test

watcher.log:

2012-09-22 04:28:23.822029 Daemon started
2012-09-22 04:28:23.822596 job1: /var/www
Traceback (most recent call last):
  File "/etc/watcher.py", line 359, in <module>
    daemon.start()
  File "/etc/watcher.py", line 124, in start
    self.run()
  File "/etc/watcher.py", line 256, in run
    autoadd   = self.config.getboolean(section,'autoadd')
  File "/usr/lib/python2.7/ConfigParser.py", line 368, in getboolean
    v = self.get(section, option)
  File "/usr/lib/python2.7/ConfigParser.py", line 618, in get
    raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'autoadd' in section: 'job1'
share|improve this question

1 Answer 1

up vote 1 down vote accepted
ConfigParser.NoOptionError: No option 'autoadd' in section: 'job1'

As far as I know, autoadd option is required. You can set it to false if you don't want to watch the new subdirectory:

; if true, watcher will automatically watch new subdirectory
autoadd=false

/tmp/watcher.log:

2012-09-23 22:30:33.934975 Daemon started
2012-09-23 22:30:33.935313 job1: /tmp

ps -ef | grep [w]atcher

quanta 19813 1 0 22:30 ? 00:00:00 /usr/bin/python2.7 ./watcher.py start --config watcher.ini

share|improve this answer
    
quanta, thanks so much for this, you made my day! Regards –  ericd Sep 23 '12 at 20:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.