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

I'm trying to use resque as a job runner for Rails. I've tried this config, and many other ways of demonizing the rescue task (because running rake resque:work leaves the terminal tied to that command). Unfortunately, their example configuration doesn't work for me. Does the configuration look correct? Or is there another way to turn the process into a daemon? Thank you :)

check process resque_worker_QUEUE
  with pidfile /data/APP_NAME/current/tmp/pids/resque_worker_QUEUE.pid
  start program = "/bin/sh -c 'cd /data/APP_NAME/current; RAILS_ENV=production QUEUE=queue_name VERBOSE=1 nohup rake environment resque:work& > log/resque_worker_QUEUE.log && echo $! > tmp/pids/resque_worker_QUEUE.pid'" as uid deploy and gid deploy
  stop program = "/bin/sh -c 'cd /data/APP_NAME/current && kill -s QUIT `cat tmp/pids/resque_worker_QUEUE.pid` && rm -f tmp/pids/resque_worker_QUEUE.pid; exit 0;'"
  if totalmem is greater than 300 MB for 10 cycles then restart  # eating up memory?
share|improve this question
    
From the FAQ /usr/share/doc/monit: How to debug monit: a) start monit; b) stop the service you want to monitor; c) run strace -f -p $(cat ~/.monit.pid) 2>&1|tee trace.out d) wait for monit to wake up and try to start the service; e) if you can see a line like this in the trace console with the significant = 0 at the end, it means monit tried to start the service: "execve("/etc/init.d/sshd", ["/etc/init.d/sshd", "start"], [/* 1 var */]) = 0" ( int this case the service is sshd). –  natxo asenjo Nov 2 '10 at 7:35
    
what distro are you using? –  Mike Feb 4 '12 at 19:31

1 Answer 1

if you want to run it as a daemon, take a loot at supervisor. Most distributions ship it directly from their package repositories.

share|improve this answer

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.