Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Fixing a mysterious .ebextensions command time out (AWS Elastic Beanstalk)
source: "<our-id>/our_fileserver/gor"
authentication: S3Access
mode: "000755"
owner: root
group: root
# Script to start Gor in the background
# Beware: We need to intercept port 8080 b/c 80 is redirected there via iptables
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
pidof /opt/gor || nohup /opt/gor --input-raw :8080 --output-http 'https://our-staging-server|1' >/dev/null 2>&1 </dev/null &
# Only container_commands can access env variables configured in EB (ENV)
# Start gor, limit it to copy max 1 req / sec
"Start Gor on Prod leader":
command: test "$ENV" = "production" && /opt/gor-in-background >/dev/null 2>&1 # ! w/o the redirect it will time-out
leader_only: true
ignoreErrors: true # returns an "error" when not in Prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.