- Notifications
You must be signed in to change notification settings - Fork383
Start daemon on AWS Elastic Beanstalk
Betty Steger edited this pageOct 10, 2022 ·1 revision
Insert the following script to.platform/hooks/postdeploy/rpush_config.sh
:
#!/bin/bashEB_APP_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config platformconfig -k AppDeployDir)EB_APP_PID_DIR="${EB_APP_DEPLOY_DIR}tmp/pids"EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config platformconfig -k AppUser)RAILS_ENV=$(/opt/elasticbeanstalk/bin/get-config environment -k RAILS_ENV)RPUSH_PID=$EB_APP_PID_DIR/rpush.pidRPUSH_CONFIG=$EB_APP_DEPLOY_DIR/config/initializers/rpush.rbcd $EB_APP_DEPLOY_DIRif [ -f $RPUSH_PID ]then su -s /bin/bash -c "bundle exec rpush stop \ -e $RAILS_ENV \ -p $RPUSH_PID \ -c $RPUSH_CONFIG" $EB_APP_USERfi. /opt/elasticbeanstalk/support/envvars.d/sysenvsleep 10su -s /bin/bash -c "bundle exec rpush start \ -e $RAILS_ENV \ -p $RPUSH_PID \ -c $RPUSH_CONFIG" $EB_APP_USERexit 0