From 315f7b0747effbd490ff3b25d85bc6399ed290a1 Mon Sep 17 00:00:00 2001 From: Attila Fazekas Date: Mon, 27 Jan 2014 09:40:29 +0100 Subject: [PATCH] Use service postgresql initdb with el6 postgresql-setup does not exists on el6, the service postgresql initdb is the documented db init command. Change-Id: I2b92a3c8e7db603eb13378e46893fc81f507405b --- lib/databases/postgresql | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/databases/postgresql b/lib/databases/postgresql index 60e5a33715..c459feb9e0 100644 --- a/lib/databases/postgresql +++ b/lib/databases/postgresql @@ -43,7 +43,13 @@ function configure_database_postgresql { if is_fedora; then PG_HBA=/var/lib/pgsql/data/pg_hba.conf PG_CONF=/var/lib/pgsql/data/postgresql.conf - sudo [ -e $PG_HBA ] || sudo postgresql-setup initdb + if ! sudo [ -e $PG_HBA ]; then + if ! [[ $DISTRO =~ (rhel6) ]]; then + sudo postgresql-setup initdb + else + sudo service postgresql initdb + fi + fi elif is_ubuntu; then PG_DIR=`find /etc/postgresql -name pg_hba.conf|xargs dirname` PG_HBA=$PG_DIR/pg_hba.conf