From ef7521c5b696e0115061fae703d4b29243536c3b Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Mon, 11 Nov 2019 19:02:04 +0100 Subject: [PATCH] =?UTF-8?q?Imprroves=20postgresql=E2=80=99s=20readiness-ch?= =?UTF-8?q?eck-command.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/postgresql.spec | 2 +- src/service/service.cr | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/services/postgresql.spec b/services/postgresql.spec index 0f681ab..5f340f6 100644 --- a/services/postgresql.spec +++ b/services/postgresql.spec @@ -2,7 +2,7 @@ name: postgresql user: postgres command: postgres -D ${SERVICE_ROOT}/db -k /tmp/postgresql-${ENVIRONMENT} #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: - PGROOT=${SERVICE_ROOT} provides: postgresql diff --git a/src/service/service.cr b/src/service/service.cr index 8d69629..4acf186 100644 --- a/src/service/service.cr +++ b/src/service/service.cr @@ -359,7 +359,10 @@ class Service now = Time.local 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? break