Whamcloud - gitweb
b=24037 Changes of 2.6.32 kernel.
[fs/lustre-release.git] / lustre / utils / automatic-reconnect-sample
1 #!/bin/sh
2
3 if [ -z "$1" ]; then
4   echo "No UUID given to Lustre upcall!" | wall
5   exit 1
6 fi
7
8 # FIXME: OSTHOST can't be hard-coded!
9 OST=$1
10 OSTHOST=dev7
11 LUSTRE=/home/pschwan/lustre/lustre
12
13 while ( ! ping -c 1 -w 3 $OSTHOST ) ; do
14   sleep 2
15 done;
16
17 echo -n "OST $OSTHOST UUID $OST responding to pings : "
18 date
19
20 $LUSTRE/utils/lctl <<EOF
21 network tcp
22 close_uuid $OST
23 del_uuid $OST
24 connect $OSTHOST 988
25 add_uuid $OST $OSTHOST
26 quit
27 EOF
28
29 $LUSTRE/utils/lctl <<EOF
30 device \$RPCDEV
31 probe
32 newconn $OST
33 quit
34 EOF