Author: tmckay
Date: 2012-01-12 22:36:13 +0000 (Thu, 12 Jan 2012)
New Revision: 5186
Modified:
trunk/cumin/bin/cumin-database
Log:
Use the /usr/bin/postgresql-setup script to initialize the database if it exists
rather than 'service postgresql initdb' or 'service postgresql start'.
This supports installlation on Fedora 16+.
Modified: trunk/cumin/bin/cumin-database
===================================================================
--- trunk/cumin/bin/cumin-database 2012-01-12 22:29:20 UTC (rev 5185)
+++ trunk/cumin/bin/cumin-database 2012-01-12 22:36:13 UTC (rev 5186)
@@ -233,11 +233,16 @@
# will leave the service running, which is different than initdb,
# but that is fine at this point because it is restarted after
# the call to configure anyway.
- echo -e "\nAttempting to use initdb option..."
- run "/sbin/service postgresql initdb" || {
- echo -e "\ninitdb option not supported, using start..."
- run "/sbin/service postgresql start"
- }
+ if [[ -f "/usr/bin/postgresql-setup" ]]; then
+ echo -e "using postgresql-setup..."
+ run "/usr/bin/postgresql-setup initdb"
+ else
+ echo -e "\nAttempting to use initdb option..."
+ run "/sbin/service postgresql initdb" || {
+ echo -e "\ninitdb option not supported, using start..."
+ run "/sbin/service postgresql start"
+ }
+ fi
# now check again, to make sure one of the two methods worked
check-initialized &> /dev/null || {
Show replies by date