Skip to content

Commit

Permalink
fix(rootfs): check if recovery.conf is present
Browse files Browse the repository at this point in the history
This allows is_running to fail when the database is in recovery mode.
  • Loading branch information
Matthew Fisher committed Jul 27, 2016
1 parent b66069b commit 38f839a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rootfs/bin/is_running
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 38f839a

Please sign in to comment.