Created
March 24, 2013 00:31
-
-
Save bhauman/5229891 to your computer and use it in GitHub Desktop.
Working on getting delayed_job up and running on Elastic Beanstalk using their .ebextentions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/usr/bin/env bash | |
# chkconfig: 2345 99 20 | |
# description: Starts and stops delayed job | |
# hopefully | |
# processname: delayed_job | |
. /opt/elasticbeanstalk/support/envvars | |
function start() { | |
pushd /var/app/current | |
RAILS_ENV=production script/delayed_job --pid-dir=/home/ec2-user/pids start | |
popd | |
} | |
function stop() { | |
pushd /var/app/current | |
RAILS_ENV=production script/delayed_job --pid-dir=/home/ec2-user/pids stop | |
popd | |
} | |
function status() { | |
pushd /var/app/current | |
RAILS_ENV=production script/delayed_job --pid-dir=/home/ec2-user/pids stop | |
popd | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
status) | |
status | |
;; | |
restart|graceful) | |
stop | |
start | |
;; | |
reload) | |
stop | |
start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart|reload|status}" | |
exit 1 | |
;; | |
esac | |
exit 0 | |
# sudo chkconfig --add delayed_job | |
# sudo chkconfig -–level 2345 delayed_job on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi did you get this working? I am struggling to get it working using http://junkheap.net/blog/2013/05/20/elastic-beanstalk-post-deployment-scripts/