Further, depencies are producing some backwards behavior.

In the following example starting redis server is triggering the start of
my resque worker, even though the dependency tree is the reverse.
IMO, starting redis-server should trigger nothing after it starts since
it's resque_worker_1 that depends on redis-server.

Here's my conf, followed by a status and tailing monit.log.
Starting with all servies turned off.


# cat /etc/monit/monit.conf
set httpd port 2812 and use the address localhost
  allow 127.0.0.1

check process redis-server
  with pidfile /var/run/redis.pid
  start program = "/etc/init.d/redis-server start" with timeout 30 seconds
  stop program = "/etc/init.d/redis-server stop"

check process resque_worker_1
  with pidfile /u/apps/stocks/shared/pids/resque_worker_1.pid
  start program = "/bin/sh -c 'cd /u/apps/stocks/current ; bundle exec rake
environment resque:work RAILS_ENV=production
QUEUE=daily_memoizer,high,medium VERBOSE=1
PIDFILE=/u/apps/stocks/shared/pids/resque_worker_1.pid >>
log/resque_worker_1.log 2>&1 &'" as uid blue and gid blue with timeout 45
seconds
  stop program = "/bin/sh -c 'cd /u/apps/stocks/shared/pids/ ; sudo kill
-QUIT $(cat resque_worker_1.pid) || true'" as uid jsharpe as gid jsharpe
with timeout 120 seconds
  if totalmem is greater than 200 MB for 5 cycles then restart
  depends on redis-server
  group resque


# monit status
The Monit daemon 5.3.2 uptime: 8m

Process 'resque_worker_1'
  status                            Not monitored
  monitoring status                 Not monitored
  data collected                    Mon, 15 Jul 2013 22:43:20

Process 'redis-server'
  status                            Not monitored
  monitoring status                 Not monitored
  data collected                    Mon, 15 Jul 2013 22:43:20

System 'system_stocks-app'
  status                            Not monitored
  monitoring status                 Not monitored
  data collected                    Mon, 15 Jul 2013 22:43:20


# monit start redis-server

/var/log/monit.log

[EDT Jul 15 22:45:26] info     : 'redis-server' start on user request
[EDT Jul 15 22:45:26] info     : monit daemon at 2898 awakened
[EDT Jul 15 22:45:26] info     : Awakened by User defined signal 1
[EDT Jul 15 22:45:26] info     : 'redis-server' start:
/etc/init.d/redis-server
[EDT Jul 15 22:45:26] error    : monit: Error reading pid from file
'/var/run/redis.pid'
[EDT Jul 15 22:45:26] info     : 'resque_worker_1' start: /bin/sh
[EDT Jul 15 22:45:46] info     : 'redis-server' start action done


# monit status | egrep 'System|Process|status'
Process 'resque_worker_1'
  status                            Running
  monitoring status                 Monitored
Process 'redis-server'
  status                            Running
  monitoring status                 Monitored
System 'system_stocks-app'
  status                            Not monitored
  monitoring status                 Not monitored
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to