Imprroves postgresql’s readiness-check-command.

master
Luka Vandervelden 2019-11-11 19:02:04 +01:00
parent f2507e2dd0
commit ef7521c5b6
2 changed files with 5 additions and 2 deletions

View File

@ -2,7 +2,7 @@ name: postgresql
user: postgres user: postgres
command: postgres -D ${SERVICE_ROOT}/db -k /tmp/postgresql-${ENVIRONMENT} command: postgres -D ${SERVICE_ROOT}/db -k /tmp/postgresql-${ENVIRONMENT}
#stop-command: kill -HUP ${PID} #stop-command: kill -HUP ${PID}
readiness-check-command: pg_isready -p ${POSTGRESQL_PORT} readiness-check-command: pg_isready -p ${PORT_POSTGRESQL} -h localhost -q
environment-variables: environment-variables:
- PGROOT=${SERVICE_ROOT} - PGROOT=${SERVICE_ROOT}
provides: postgresql provides: postgresql

View File

@ -359,7 +359,10 @@ class Service
now = Time.local now = Time.local
while (now - start_time).seconds < 5 while (now - start_time).seconds < 5
r = Process.run "sh", ["-c", command] r = Process.run "sh", ["-c", command],
output: Process::Redirect::Inherit,
error: Process::Redirect::Inherit,
env: commands_environment
if r.success? if r.success?
break break