Author: tmckay
Date: 2011-01-07 16:17:35 +0000 (Fri, 07 Jan 2011)
New Revision: 4456
Modified:
branches/1.3.2/cumin/bin/cumin-database
Log:
Merge in revision 4453 and 4454 from trunk.
BZ667719
(related to BZ667653)
Modified: branches/1.3.2/cumin/bin/cumin-database
===================================================================
--- branches/1.3.2/cumin/bin/cumin-database 2011-01-07 15:13:08 UTC (rev 4455)
+++ branches/1.3.2/cumin/bin/cumin-database 2011-01-07 16:17:35 UTC (rev 4456)
@@ -151,7 +151,11 @@
check-environment || exit 1
check-initialized || exit 1
- /sbin/service postgresql restart
+ # The postgresql 8.1.22 init script violates LSB 3.1 Chapter 20.2,
+ # and returns 1 on a successful restart of a stopped service. A
+ # proper restart is thus simulated with condstop and start.
+ /sbin/service postgresql condstop
+ /sbin/service postgresql start
}
function initialize {
@@ -170,9 +174,10 @@
# On older versions of Postgres (before 8.4), initdb does not exist but
# using the start option will initialize the database, then start it.
- # Try initdb first, and if it fails try start followed by stop. This
- # should leave the database and the service in the same state on all
- # 8.x versions of Postgres.
+ # Try initdb first, and if it fails try start. The "start" method
+ # 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..."
Show replies by date