Skip to content

Commit

Permalink
Merge pull request #49 from docksal/develop
Browse files Browse the repository at this point in the history
Release 1.5.1
  • Loading branch information
lmakarov authored May 1, 2019
2 parents 1809fd4 + 6c50bab commit c94d4e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Allow using a different docker binary
DOCKER ?= docker

VERSION ?= dev
Expand Down
27 changes: 17 additions & 10 deletions healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/usr/bin/env bash

# nginx config is valid
nginx -t || exit 1
#set -x # Print commands
set -e # Exit on errors

# supervisor services are running
if [[ -f /run/supervisord.pid ]]; then
supervisorctl status docker-gen | grep RUNNING >/dev/null || exit 1
supervisorctl status nginx | grep RUNNING >/dev/null || exit 1
supervisorctl status crond | grep RUNNING >/dev/null || exit 1
# Check nginx config is valid
echo "Checking nginx configuration..."
nginx -t

exit 0
fi
# Check supervisor running
echo "Checking supervisor..."
# Need to do "|| exit 1" here since "set -e" apparently does not care about tests.
[[ -f /run/supervisord.pid ]] || exit 1

exit 1
# Check supervisor controlled services
# Since "supervisorctl status" is heavy and the healthcheck runs quit often, we use "ps" here
echo "Checking supervisor services..."
pslist=$(ps)
echo ${pslist} | grep docker-gen >/dev/null
echo ${pslist} | grep "nginx: master process" >/dev/null
echo ${pslist} | grep "nginx: worker process" >/dev/null
echo ${pslist} | grep crond >/dev/null

0 comments on commit c94d4e0

Please sign in to comment.