summaryrefslogtreecommitdiffstats
path: root/postgresql-setup.in
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2015-09-25 10:42:55 +0200
committerPavel Raiskup <praiskup@redhat.com>2015-09-25 10:53:31 +0200
commitb3502bb172f127d91ef59d5cd423ec1c9b12b3cb (patch)
treeac158f2f3d8d40b6d81b80d9be296f1467142d6c /postgresql-setup.in
parent31d6d5504c4c26b19bc295e15b5893566826351f (diff)
downloadpostgresql-setup-b3502bb172f127d91ef59d5cd423ec1c9b12b3cb.tar.gz
postgresql-setup-b3502bb172f127d91ef59d5cd423ec1c9b12b3cb.tar.xz
postgresql-setup-b3502bb172f127d91ef59d5cd423ec1c9b12b3cb.zip
postgresql-setup: warn for $PGDATA mountpoints
Resolves: rhbz#1247477 * configure.ac (MOUNTPOINT): New configure-time variable. * postgresql-setup.in: Warn if $pgdata or `dirname $pgdata` is a mountpoint. * NEWS: Document. * README: Document that its better to have util-linux in BR.
Diffstat (limited to 'postgresql-setup.in')
-rw-r--r--postgresql-setup.in10
1 files changed, 10 insertions, 0 deletions
diff --git a/postgresql-setup.in b/postgresql-setup.in
index 7d5a0eb..20d5ad6 100644
--- a/postgresql-setup.in
+++ b/postgresql-setup.in
@@ -793,6 +793,16 @@ debug "final pgport: $pgport"
script_result=0
+if @MOUNTPOINT@ -q "$pgdata" || @MOUNTPOINT@ -q "$(dirname "$pgdata")"; then
+ warn $"Note that either your data directory '$pgdata' or"
+ warn_q $"the parent directory '$(dirname "$pgdata")'"
+ warn_q $"is a direct mountpoint. This is usually bad idea and your"
+ warn_q $"filesystem layout should ideally look like:"
+ warn_q $"/ROOT_OWNED_MOUNTPOINT/POSTGRES_OWNED_DIRECTORY/DATADIR."
+ warn_q $"See the upstream documentation for more info:"
+ warn_q $"http://www.postgresql.org/docs/@PGMAJORVERSION@/static/creating-cluster.html"
+fi
+
# See how we were called.
case "$option_mode" in
initdb)