-
Notifications
You must be signed in to change notification settings - Fork 0
/
stoprun.sh
executable file
·55 lines (47 loc) · 1.21 KB
/
stoprun.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
set -eu
LOGDIR="out/" ;
usage () { # {{{
cat <<-USAGE
usage: $0 -i NODELIST -l SLICE [-t TIMEOUT]
will call plpt stop in each node in NODELIST. assumes deployment files
were copied in advance (e.g., with copy.sh). SLICE should be a planetlab slice
name (e.g., upmc_ts). TIMEOUT defaults to 30 seconds.
USAGE
exit 1
} # }}}
nodelist=invalid
slice=invalid
timeout=30
while getopts "i:l:t:h" OPTNAME ; do # {{{
case $OPTNAME in
i)
nodelist=$OPTARG
;;
l)
slice=$OPTARG
;;
t)
timeout=$OPTARG
;;
h|*)
usage
;;
esac
done
shift $(expr $OPTIND - 1)
OPTIND=1 # }}}
test $nodelist != invalid || usage
test $slice != invalid || usage
vxargs -pry -t $timeout -a $nodelist -o $LOGDIR/stop/ \
ssh $slice@{} sudo /home/$slice/plpt stop
vxargs -pry -t $timeout -a $nodelist -o $LOGDIR/stop/ \
ssh $slice@{} sudo /etc/init.d/plpt stop
vxargs -pry -t $timeout -a $nodelist -o $LOGDIR/stop/ \
ssh $slice@{} sudo killall -9 parisloop
vxargs -pry -t $timeout -a $nodelist -o $LOGDIR/stop/ \
ssh $slice@{} sudo pkill -9 parisloop
vxargs -pry -t $timeout -a $nodelist -o $LOGDIR/stop/ \
ssh $slice@{} sudo killall -9 paristr
vxargs -pry -t $timeout -a $nodelist -o $LOGDIR/stop/ \
ssh $slice@{} sudo pkill -9 paristr