I have a rails app that uses rescue. The app is deployed using elastic beanstalk (64bit Amazon Linux 2015.09 v2.0.6 running Ruby 2.1 (Passenger Standalone)) and I am trying to use monit to run rescue. After some research .ebextensions seem to be the way to go. However it looks as if the file is being ignored. I don't see the file (/var/app/current/tmp/success) I put to debug things being written, monit is not installed and the monit config file is not being created.
myapp
.ebextensions
99run.config
Here is the contents of 99run.config
packages:
yum:
monit: []
files:
"/etc/monit.d/resque_worker":
mode: "000644"
owner: root
group: root
content: |
check process resque_worker_QUEUE
with pidfile /var/app/current/tmp/resque_worker_QUEUE.pid
start program = "/bin/sh -l -c 'cd /var/app/current; nohup rake environment resque:work QUEUE=* VERBOSE=1 PIDFILE=/var/app/current/tmp/resque_worker_QUEUE.pid >> /var/app/current/log/resque_worker_QUEUE.log 2>&1'" as uid webapp and gid webapp
stop program = "/bin/sh -c 'cd /var/app/current && kill -9 $(cat /var/app/current/tmp/resque_worker_QUEUE.pid) && rm -f /var/app/current/tmp/resque_worker_QUEUE.pid; exit 0;'"
if totalmem is greater than 300 MB for 10 cycles then restart # eating up memory?
group resque_workers
commands:
test_command:
command: echo "ebextensions ran" > /var/app/current/tmp/success
service:
sysvinit:
monit:
ensureRunning: true
enabled: true