Browse code

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

Attila Fazekas authored on 2014/01/27 17:40:29
Showing 1 changed files
... ...
@@ -43,7 +43,13 @@ function configure_database_postgresql {
43 43
     if is_fedora; then
44 44
         PG_HBA=/var/lib/pgsql/data/pg_hba.conf
45 45
         PG_CONF=/var/lib/pgsql/data/postgresql.conf
46
-        sudo [ -e $PG_HBA ] || sudo postgresql-setup initdb
46
+        if ! sudo [ -e $PG_HBA ]; then
47
+            if ! [[ $DISTRO =~ (rhel6) ]]; then
48
+                sudo postgresql-setup initdb
49
+            else
50
+                sudo service postgresql initdb
51
+            fi
52
+        fi
47 53
     elif is_ubuntu; then
48 54
         PG_DIR=`find /etc/postgresql -name pg_hba.conf|xargs dirname`
49 55
         PG_HBA=$PG_DIR/pg_hba.conf