summaryrefslogtreecommitdiffstats
path: root/postgresql.service.in
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-07-04 10:29:36 +0200
committerPavel Raiskup <praiskup@redhat.com>2014-07-04 10:45:22 +0200
commit7bc6b1e356a0c157e575167c6fa57f647f52d601 (patch)
treebef38a1ebc44aa5ad3478eb578e582b84b27ddb6 /postgresql.service.in
parent7a9df4d2886ef19417db9f4cf0c65b3160f877fc (diff)
downloadpostgresql-setup-7bc6b1e356a0c157e575167c6fa57f647f52d601.tar.gz
postgresql-setup-7bc6b1e356a0c157e575167c6fa57f647f52d601.tar.xz
postgresql-setup-7bc6b1e356a0c157e575167c6fa57f647f52d601.zip
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.
Diffstat (limited to 'postgresql.service.in')
-rw-r--r--postgresql.service.in2
1 files changed, 1 insertions, 1 deletions
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.