Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > d536e3b2143fe88c174c968d683c0f4f > files > 4

conga-0.12.2-24.el5_6.1.src.rpm

diff -ur conga-0.12.2.orig/luci/init.d/luci conga-0.12.2/luci/init.d/luci
--- conga-0.12.2.orig/luci/init.d/luci	2009-05-21 09:35:23.000000000 -0400
+++ conga-0.12.2/luci/init.d/luci	2010-02-09 13:24:24.000000000 -0500
@@ -30,6 +30,8 @@
 
 LUCI_USER='luci'
 LUCI_GROUP='luci'
+LUCI_ZOPE_TIMEOUT=30
+LUCI_STUNNEL_TIMEOUT=10
 
 LUCI_URL="https://`/bin/hostname`:$LUCI_HTTPS_PORT"
 
@@ -121,7 +123,7 @@
 stop()
 {
 	stop_stunnel
-	max_wait=5
+	max_wait=$LUCI_STUNNEL_TIMEOUT
 	cur_wait=0
 	while [ $cur_wait -lt $max_wait ]; do
 		sleep 1
@@ -133,12 +135,16 @@
 	done
 
 	if [ $? -ne 0 ]; then
-		errmsg='Failed to stop stunnel'
+		if [ $cur_wait -eq $max_wait ]; then
+			errmsg="stunnel did not stop after $max_wait seconds."
+		else
+			errmsg='Failed to stop stunnel'
+		fi
 		return 1
 	fi
 
 	stop_luci
-	max_wait=10
+	max_wait=$LUCI_ZOPE_TIMEOUT
 	cur_wait=0
 	while [ $cur_wait -lt $max_wait ]; do
 		sleep 1
@@ -150,7 +156,11 @@
 	done
 
 	if [ $? -ne 0 ]; then
-		errmsg='Failed to stop luci'
+		if [ $cur_wait -eq $max_wait ]; then
+			errmsg="Luci did not stop after $max_wait seconds."
+		else
+			errmsg='Failed to stop luci'
+		fi
 		return 1
 	fi
 	return 0
@@ -170,7 +180,7 @@
 	sh $LUCID >&/dev/null &
 
 	cur_wait=0
-	max_wait=10
+	max_wait=$LUCI_ZOPE_TIMEOUT
 	luci_running
 	ret=$?
 	while [ $ret -ne 1 ] && [ $cur_wait -lt $max_wait ]; do
@@ -181,7 +191,11 @@
 	done
 
 	if [ $ret -ne 1 ]; then
-		errmsg='An error occurred while starting luci'
+		if [ $cur_wait -eq $max_wait ]; then
+			errmsg="Luci did not start after $max_wait seconds."
+		else
+			errmsg='An error occurred while starting luci'
+		fi
 		stop_luci
 		return 1
 	fi
@@ -193,7 +207,7 @@
 		return 1
 	fi
 
-	max_wait=5
+	max_wait=$LUCI_STUNNEL_TIMEOUT
 	cur_wait=0
 	stunnel_running
 	ret=$?
@@ -205,7 +219,11 @@
 	done
 
 	if [ $ret -ne 2 ]; then
-		errmsg='An error occurred while starting stunnel'
+		if [ $cur_wait -eq $max_wait ]; then
+			errmsg="stunnel did not start after $max_wait seconds."
+		else
+			errmsg='An error occurred while starting stunnel'
+		fi
 		stop_luci >& /dev/null
 		stop_stunnel >& /dev/null 
 		return 1
@@ -323,7 +341,7 @@
 			exit 0
 		else
 			echo_failure
-			/usr/bin/logger -t "$ID" -- "Luci startup failed $errmsg"
+			/usr/bin/logger -t "$ID" -- "Luci startup failed: $errmsg"
 			echo
 			exit 1
 		fi
@@ -370,7 +388,7 @@
 				/usr/bin/logger -t "$ID" -- "Luci shutdown succeeded"
 				rtrn=0
 			else
-				/usr/bin/logger -t "$ID" -- "Luci shutdown failed"
+				/usr/bin/logger -t "$ID" -- "Luci shutdown failed: $errmsg"
 				rtrn=1
 			fi
 		elif [ $rtrn -eq 0 ]; then