Skip to content

Commit

Permalink
open-osd: up-pan: Bug fixing, add the stat command
Browse files Browse the repository at this point in the history
tested on actual shelf thsi time.
Add the stat command to print UP or DOWN

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
  • Loading branch information
Boaz Harrosh committed Nov 3, 2011
1 parent 382ac09 commit 66b1b25
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions up-pan
Original file line number Diff line number Diff line change
@@ -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`
Expand All @@ -14,19 +15,30 @@ set LOG="/var/log/otgtd.log"

switch($1)
case "down":
killall $OTGTD
killall $OTGTD_NAME
exit
breaksw

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?!?"
Expand Down

0 comments on commit 66b1b25

Please sign in to comment.