diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2014-09-16 12:33:59 +0200 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2014-09-16 13:46:48 +0200 |
commit | 79966819a5ef4d989f594a01c0d54a47425a9494 (patch) | |
tree | 246e451932d6f169814516fe7b8f6e7892cf8bb3 /postgresql-check-db-dir.in | |
parent | 112c8af118dfa21b79b4f86e286c3f0bf510884a (diff) | |
download | postgresql-setup-79966819a5ef4d989f594a01c0d54a47425a9494.tar.gz postgresql-setup-79966819a5ef4d989f594a01c0d54a47425a9494.tar.xz postgresql-setup-79966819a5ef4d989f594a01c0d54a47425a9494.zip |
postgresql-check-db-dir: migrate from /etc/postgresql/*
Diffstat (limited to 'postgresql-check-db-dir.in')
-rw-r--r-- | postgresql-check-db-dir.in | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/postgresql-check-db-dir.in b/postgresql-check-db-dir.in index 2dd0649..188c7de 100644 --- a/postgresql-check-db-dir.in +++ b/postgresql-check-db-dir.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # This script verifies that the postgresql data directory has been correctly # initialized. We do not want to automatically initdb it, because that has @@ -17,20 +17,23 @@ service_name="$1" if [ -z "$PGDATA" ]; then echo $"You try to start '$service_name' service" echo $"but the required \$PGDATA environment variable is not set." - echo $"You should use the @PKGCONFIG_DIR@/$service_name" + echo $"You should use the @userunitsdir@/$service_name.d/ANYTHING.conf" echo $"configuration file to set \$PGDATA. For more info see" echo $"the @README_DIST@ file." exit 1 fi -# Warn the user that the configuration should be adjusted. -conf_file="@PKGCONFIG_DIR@/$service_name" -if test ! -r "$conf_file"; then - echo >&2 $"WARNING: Note that file '$conf_file'" - echo >&2 $"does not exist. Your configuration will be supported for some" - echo >&2 $"time but you are encouraged to create this file according to" - echo >&2 $"@README_DIST@ documentation." +# Warn the user that the configuration should be adjusted via drop-in, in case +# the $PGDATA variable is set different way (and non-default service name is +# used). +conf_dir="@userunitsdir@/$service_name.d" +if [[ "$service_name" == *@* ]] && test ! -d "$conf_dir"; then + echo >&2 $"WARNING: Note that the '$conf_dir'" + echo >&2 $"directory does not exist while you are using non-default service" + echo >&2 $"name '$service_name'. You are encouraged to use the" + echo >&2 $"$conf_dir directory for systemd configuration according" + echo >&2 $"to @README_DIST@ documentation." fi # Full PostgreSQL version, e.g. 9.0.2 |