From 5a80fb108cd5eb8d089652a83e39f704c7f87eab Mon Sep 17 00:00:00 2001 From: lighta Date: Fri, 19 Dec 2014 21:45:56 -0500 Subject: [PATCH] athena-start Add the valgrind start option for debug purpose. --- athena-start | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/athena-start b/athena-start index 2139bd078d..b62fb95bdc 100755 --- a/athena-start +++ b/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 {}'" + echo "syntax: 'restart {}'" 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 { }'" 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 { }'" + echo "syntax: 'watch { }'" echo "The watch option allow you to auto restart the server when this one was stopped" echo " delay in second before recheking if server are down (default 10) " echo " 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 ;;