From 66b1b25a2d085415294262f8f704365bbac99041 Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Wed, 2 Nov 2011 18:25:04 -0700 Subject: [PATCH] open-osd: up-pan: Bug fixing, add the stat command tested on actual shelf thsi time. Add the stat command to print UP or DOWN Signed-off-by: Boaz Harrosh --- up-pan | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/up-pan b/up-pan index 90d1ef3..b104f74 100755 --- a/up-pan +++ b/up-pan @@ -1,11 +1,12 @@ -#!/bin/csh -x +#!/bin/csh # On Pan-OSD there is only one target set BACKSTORE0=/root/pandata/ # Path to pan_tgtd executables, assuming p4 integration -dir="/pan/bin" +set dir=/pan/bin set TGTADM=$dir/tgtadm -set OTGTD=$dir/pan_tgtd +set OTGTD_NAME=pan_tgtd +set OTGTD=$dir/$OTGTD_NAME # Get the osd device id set TARGETNAME=`/pan/bin/getdevinfo -q datasn` @@ -14,7 +15,7 @@ set LOG="/var/log/otgtd.log" switch($1) case "down": - killall $OTGTD + killall $OTGTD_NAME exit breaksw @@ -22,11 +23,22 @@ case "log": less +F $LOG exit breaksw + case "log-reset": echo > $LOG exit breaksw +case "stat": + set stat=`ps ax | grep pan_tgtd` + if ( "x${stat}" == "x" ) then + echo "DOWN" + else + echo "UP" + endif + exit + breaksw + default: if ("$1" != "") then echo "what is $0 $1?!?"