Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/
  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/'" as uid deploy and gid deploy
  stop program = "/bin/sh -c 'cd /data/APP_NAME/current && kill -s QUIT `cat tmp/pids/` && rm -f tmp/pids/; 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 ~/ 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

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


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.