Private
Public Access
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0d62c91f8 |
+10
-1
@@ -112,7 +112,16 @@ HEALTH_PORT="${HEALTH_BIND##*:}"
|
||||
if [ "$HEALTH_HOST" = "0.0.0.0" ]; then
|
||||
HEALTH_HOST="127.0.0.1"
|
||||
fi
|
||||
if curl -sf "http://$HEALTH_HOST:$HEALTH_PORT/health/" >/dev/null; then
|
||||
# Use the venv's own Python rather than curl — curl isn't guaranteed to be
|
||||
# installed on a minimal host, but the venv obviously already is.
|
||||
if "$VENV_DIR/bin/python" -c "
|
||||
import sys, urllib.request
|
||||
try:
|
||||
urllib.request.urlopen('http://$HEALTH_HOST:$HEALTH_PORT/health/', timeout=5)
|
||||
except Exception as e:
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
"; then
|
||||
echo "Health check OK"
|
||||
else
|
||||
echo "Health check FAILED — check: journalctl -u evection-gunicorn -n 50" >&2
|
||||
|
||||
Reference in new issue
Block a user