Search code examples
rakemonit

How can I monitor a rake task with monit?


I have a rake task that I want to run forever and ever and ever. It's job is to monitor a table and process entries in that table as they occur (from another rake task that I need to monitor also).

I am already using monit to monitor a Sidekiq worker. However, I don't know what to put in the "stop" entry in the monitrc file. The only way I would know how to kill a rake task is with the kill command.

How can I ensure that my two rake tasks are restarted if they are killed or if they die?

I found a link to a list of examples, but none of them are really even close to what I need.


Solution

  • I found a great resource here.