문제

I have setup a mailman script in my rails app to download and process emails. This is working fine.

The script is located in the scripts directory of the rails app.

I need this script to run upon deployment, via monit (which I am using for other services).

I am not sure how to configure monit to run this particular script (as it has no start/stop functions etc).

Using Ubuntu 12.04 on the server.

도움이 되었습니까?

해결책

Pretty outdated question, but in case somebody is looking for the same - you can use gem Daemons and create a wrapper script, something like:

#!/usr/bin/env ruby
require 'daemons'

Daemons.run('script/mailman_server')

Then you get start and stop commands and can do:

bundle exec script/mailman_daemon start

and

bundle exec script/mailman_daemon stop
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top