Explorar el Código

athena-start

Add the valgrind start option for debug purpose.
lighta hace 10 años
padre
commit
5a80fb108c
Se han modificado 1 ficheros con 30 adiciones y 9 borrados
  1. 30 9
      athena-start

+ 30 - 9
athena-start

@@ -149,16 +149,28 @@ case $1 in
 		 restart
 	;;
 	'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')
 		case $2 in
 			'start')
-				echo "syntaxe: 'start {--enlog}'"
+				echo "syntax: 'start {--enlog}'"
 				echo "This option will starts the servs"
 				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'"
 			;;
 			'restart')
-				echo "syntaxe: 'restart {<delay>}'"
+				echo "syntax: 'restart {<delay>}'"
 				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"
 			;;
 			'status')
+				echo "syntax: 'watch {<restart_intervall> <restart_count>}'"
 				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 " If it wasn't the case please use something like 'ps ax | grep server' to know their status"
 			;;
 			'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 "<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)"
 			;;
+			'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 }"
 				read -p "Enter a valid command: " readEnterKey
@@ -189,7 +210,7 @@ case $1 in
 		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
 		$0 $readEnterKey
 	;;