From 7bc6b1e356a0c157e575167c6fa57f647f52d601 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Fri, 4 Jul 2014 10:29:36 +0200 Subject: service: avoid cryptic failure with old config If user removes currently provided /etc/postgresql/postgresql configuration file, PGDATA env variable is not set. The `systemctl start postgresql` would fail similarly to `systemctl start postgresql@NOTCONFIGURED` when the configuration file was not created yet with cryptic message "Usage: ... " Stop this behavior rather explicitly with proper error in check-db-dir script. Warn also user in similar fashion that the configuration should be adjusted in case the PGDATA was set directly in service file. --- postgresql.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'postgresql.service.in') diff --git a/postgresql.service.in b/postgresql.service.in index ad0a3e1..4b9fc95 100644 --- a/postgresql.service.in +++ b/postgresql.service.in @@ -27,7 +27,7 @@ OOMScoreAdjust=-1000 Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj Environment=PG_OOM_ADJUST_VALUE=0 -ExecStartPre=@libexecdir@/postgresql-check-db-dir ${PGDATA} +ExecStartPre=@libexecdir@/postgresql-check-db-dir %N # Temporarily use postgresql-ctl wrapper around pg_ctl until there will # exist clients which set PGPORT in service file. -- cgit