diff --git a/rootfs/bin/is_running b/rootfs/bin/is_running index ff3346d..4f66c3a 100755 --- a/rootfs/bin/is_running +++ b/rootfs/bin/is_running @@ -3,5 +3,9 @@ # fail fast set -e -# check if database is running +if [[ -f "$PGDATA/recovery.conf" ]]; then + # postgres is in recovery mode, so we know it's not ready to accept incoming connections. + exit 1 +fi + gosu postgres pg_ctl status