Browse Source

athena-start

Add the valgrind start option for debug purpose.
lighta 10 years ago
parent
commit
5a80fb108c
1 changed files with 30 additions and 9 deletions
  1. 30 9
      athena-start

+ 30 - 9
athena-start

@@ -149,16 +149,28 @@ case $1 in
 		 restart
 		 restart
 	;;
 	;;
 	'status')
 	'status')
-	for i in ${L_SRV} ${C_SRV} ${M_SRV}
-	do
-		get_status ${i}
-		if [ ${PSRUN} ]; then echo "'${i}' is running p${PSRUN}"; else echo "'${i}' seem down"; fi
-	done
+		for i in ${L_SRV} ${C_SRV} ${M_SRV}
+		do
+			get_status ${i}
+			if [ ${PSRUN} ]; then echo "'${i}' is running p${PSRUN}"; else echo "'${i}' seem down"; fi
+		done
+	;;
+	'val_runonce')
+		for i in ${L_SRV} ${C_SRV} ${M_SRV}
+		do
+			valgrind --leak-check=full --show-leak-kinds=all ./$i --run-once > "log/$i.runonce.leak"
+		done
+	;;
+	'valchk')
+		for i in ${L_SRV} ${C_SRV} ${M_SRV}
+		do
+			valgrind --leak-check=full --show-leak-kinds=all ./$i > "log/$i.runonce.leak"
+		done
 	;;
 	;;
 	'help')
 	'help')
 		case $2 in
 		case $2 in
 			'start')
 			'start')
-				echo "syntaxe: 'start {--enlog}'"
+				echo "syntax: 'start {--enlog}'"
 				echo "This option will starts the servs"
 				echo "This option will starts the servs"
 				echo "--enlog will tee all terminal output into a log/$servname.log file"
 				echo "--enlog will tee all terminal output into a log/$servname.log file"
 			;;
 			;;
@@ -166,21 +178,30 @@ case $1 in
 				echo "This option will shutdowns the servs'"
 				echo "This option will shutdowns the servs'"
 			;;
 			;;
 			'restart')
 			'restart')
-				echo "syntaxe: 'restart {<delay>}'"
+				echo "syntax: 'restart {<delay>}'"
 				echo "This option will wait delay then will attempt to restart the servs"
 				echo "This option will wait delay then will attempt to restart the servs"
 				echo "NB, even if delay is over it will wait the pid is finished before atetmpting to restart servs"
 				echo "NB, even if delay is over it will wait the pid is finished before atetmpting to restart servs"
 			;;
 			;;
 			'status')
 			'status')
+				echo "syntax: 'watch {<restart_intervall> <restart_count>}'"
 				echo "This option let you know if the server are running or not"
 				echo "This option let you know if the server are running or not"
 				echo "NB this option is based on PID and supposed you have launch the serv by this script"
 				echo "NB this option is based on PID and supposed you have launch the serv by this script"
 				echo " If it wasn't the case please use something like 'ps ax | grep server' to know their status"
 				echo " If it wasn't the case please use something like 'ps ax | grep server' to know their status"
 			;;
 			;;
 			'watch')
 			'watch')
-				echo "syntaxe: 'watch {<restart_intervall> <restart_count>}'"
+				echo "syntax: 'watch {<restart_intervall> <restart_count>}'"
 				echo "The watch option allow you to auto restart the server when this one was stopped"
 				echo "The watch option allow you to auto restart the server when this one was stopped"
 				echo "<restart_intervall> delay in second before recheking if server are down (default 10) "
 				echo "<restart_intervall> delay in second before recheking if server are down (default 10) "
 				echo "<restart_count> how many time should we restart servs (default 3), (-1=undefinitly)"
 				echo "<restart_count> how many time should we restart servs (default 3), (-1=undefinitly)"
 			;;
 			;;
+			'val_runonce')
+				echo "syntax: 'val_runonce'"
+				echo "This option will run valgrin with run-once to check the serv"
+			;;
+			'valchk')
+				echo "syntax: 'valchk'"
+				echo "This option will run valgrin with the serv"
+			;;
 			*)
 			*)
 				echo "Please specify a command you'll like more info  { start | stop | restart | status | watch }"
 				echo "Please specify a command you'll like more info  { start | stop | restart | status | watch }"
 				read -p "Enter a valid command: " readEnterKey
 				read -p "Enter a valid command: " readEnterKey
@@ -189,7 +210,7 @@ case $1 in
 		esac
 		esac
 	;;
 	;;
 	*)
 	*)
-		echo "Usage: athena-start { start | stop | restart | status | watch | help }"
+		echo "Usage: athena-start { start | stop | restart | status | watch | help | val_runonce | valchk }"
 		read -p "Enter a valid option: " readEnterKey
 		read -p "Enter a valid option: " readEnterKey
 		$0 $readEnterKey
 		$0 $readEnterKey
 	;;
 	;;