Skip to content

Instantly share code, notes, and snippets.

@thegalexc
Created August 18, 2016 19:54
Show Gist options
  • Save thegalexc/844dd0eb64a98c508fbf9f046c1460e5 to your computer and use it in GitHub Desktop.
Save thegalexc/844dd0eb64a98c508fbf9f046c1460e5 to your computer and use it in GitHub Desktop.
Simple example of an entry point that starts the health_check.py server as a background process
#!/bin/bash
# Set the Python path
#
READLINK=$(command -v greadlink || command -v readlink || die "...Error: readlink is not in your path! Are you in the right virtualenv?")
DIRNAME=$(dirname $0)
PYTHONPATH=$($READLINK -f $DIRNAME/..)
echo "Starting healthcheck server as background process ..."
CONTAINER_IP=$(curl -s http://rancher-metadata/2015-12-19/self/container/primary_ip)
CONTAINER_IP=$CONTAINER_IP python bin/health_check.py &
python my_awesome_script.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment