Author: tmckay
Date: 2012-05-23 17:00:00 +0000 (Wed, 23 May 2012)
New Revision: 5389
Modified:
trunk/cumin/bin/cumin-database
Log:
Add logging to /var/log/messages for unhandled errors connecting to the database in
check-created-wait. This is to provide information on startup failures at boot.
Modified: trunk/cumin/bin/cumin-database
===================================================================
--- trunk/cumin/bin/cumin-database 2012-05-21 20:05:36 UTC (rev 5388)
+++ trunk/cumin/bin/cumin-database 2012-05-23 17:00:00 UTC (rev 5389)
@@ -125,30 +125,31 @@
function check-created-wait {
for ((c=0; c<=30; c++))
do
- res="$(psql -d cumin -U cumin -h localhost -c '\q'
2>&1)"
+ res="$(psql -d cumin -U cumin -h localhost -c '\q'
2>&1)" || true
case $res in
*"could not connect"* | *"database system is starting
up"*)
if [ $c -eq 0 ] ; then
echo
fi
- echo $res
- echo retry...
+ echo "Error connecting to the database server, retry"
sleep 1
;;
"")
return 0
;;
*)
- echo $res
- echo "Error: The database may not be created"
+ logger -p daemon.error $res
+ echo "Error: Could not connect to the database server."
+ echo "Check /var/log/messages for the specific error."
+ echo "The database may not be created."
if [ "$1" != noadvice ]; then
- echo "Hint: Run 'cumin-database install'"
+ echo "Hint: Try 'cumin-database install'"
fi
return 1
;;
esac
done
- echo "Error: Could not connect to server"
+ echo "Error: Could not connect to the database server"
return 1
}
Show replies by date