Skip to content

Instantly share code, notes, and snippets.

@bhauman
Created March 24, 2013 00:31
Show Gist options
  • Save bhauman/5229891 to your computer and use it in GitHub Desktop.
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
!/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
@dhanushram
Copy link

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment