Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert Monit and BackgroundDB...

Replytotopic

Monit and BackgroundDB

Posted in Forums : Ask a Rails expert

 
Profile

Authority 50
Posting Rating 32
Sign in to rate this post

I know that this is only vaguely a “Rails” question but it has me stumped.

I am having trouble getting backgroundrb started through Monit.

I end up with “Does not exist” as the Monit status.

1. check process backgroundrb
 2.  
 3.         with pidfile /var/www/apps/shared/pids/backgroundrb_12000.pid
 4.  
 5.         start program = "/usr/bin/ruby /var/www/apps/current/script/backgroundrb start -e production" 
 6.  
 7.         stop program = "/usr/bin/ruby /var/www/apps/current/script/backgroundrb stop" 
 8.  
 9.         if totalmem is greater than 80.0 MB for 4 cycles then restart
10.  
11.         if cpu is greater than 80% for 4 cycles then restart
12.  
13.         if 20 restarts within 20 cycles then timeout
14.  
15.         group app

I can start backgrounrb fine from the command line using:
”/usr/bin/ruby /var/www/apps/current/script/backgroundrb start -e production”

Wondering why this may cause trouble when called by Monit.

My mongrel_cluster config works fine and Monit is managing it.

 
Profile

Authority 12
Posting Rating 100
Sign in to rate this post

This is just a guess but I would try looking at the file permissions. Maybe you don’t have enough rights for the user that monit runs as?

 
Profile

Authority 50
Posting Rating 32
Sign in to rate this post

Thanks for the response.
I’ve checked the permissions and they are the same for the mongrel_cluster.

My syslog looks like this:
Mar 27 03:45:20 monit15477: ‘backgroundrb’ process is not running
Mar 27 03:45:20 monit15477: ‘backgroundrb’ trying to restart
Mar 27 03:45:20 monit15477: ‘backgroundrb’ start: /usr/bin/ruby
Mar 27 03:48:20 monit15477: ‘backgroundrb’ process is not running
Mar 27 03:48:20 monit15477: ‘backgroundrb’ trying to restart
Mar 27 03:48:20 monit15477: ‘backgroundrb’ start: /usr/bin/ruby

Don’t appear to be any errors. Just nothing …

 
Pjones

Authority 62
Posting Rating 86
Sign in to rate this post

After monit tries to start backgrounddrb, have you checked the process table to see if it was started, and then maybe died? Does the PID file get created? If you run the start command, exactly as it is in monit, from the command line, what happens?

 
Profile

Authority 50
Posting Rating 32
Sign in to rate this post

Peter, thanks, that got it.
It’s been working … there was just a backroundrb process that was open and stopping monit from managing it.

Replytotopic

Other Recent Topics

Ask a Rails expert : how to execute the url from my controller

Ask a Rails expert : conditional action caching multiple mongrel clusters

Ask a Rails expert : Using like command in RoR

Ask a Rails expert : Apache ActionController:RoutingError

Ask a Rails expert : Multiple csv file upload based on data in a form

Ask a Rails expert : Exception error code

Ask a Rails expert : Tracking down an issue

Ask a Rails expert : Thread Vs Transaction

Ask a Rails expert : implementing whitelist plugin

Ask a Rails expert : Validation helper

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel