fix kill command

pull/43/head
Minh Doan 6 years ago
parent 9dd9df205a
commit 9eab536c14
  1. 9
      aws-experiment-launch/experiment/commander/main.go
  2. 2
      aws-experiment-launch/experiment/soldier/main.go
  3. 2
      aws-experiment-launch/new-pipeline/userdata-soldier.sh

@ -126,9 +126,12 @@ func dictateNode(addr string, command string) int {
// read response
buff := make([]byte, 1024)
n, _ := conn.Read(buff)
log.Printf("Receive from %s: %s", addr, buff[:n])
return 1
if n, err := conn.Read(buff); err == nil {
log.Printf("Receive from %s: %s", addr, buff[:n])
return 1
} else {
return 0
}
}
func handleUploadRequest(w http.ResponseWriter, r *http.Request) {

@ -150,7 +150,7 @@ func handleInitCommand(args []string, w *bufio.Writer) {
func handleKillCommand(w *bufio.Writer) {
log.Println("Kill command")
runCmd("../kill_node.sh")
runCmd("./kill_node.sh")
logAndReply(w, "Kill command done.")
}

@ -5,10 +5,12 @@ curl http://unique-bucket-bin.s3.amazonaws.com/txgen -o txgen
curl http://unique-bucket-bin.s3.amazonaws.com/soldier -o soldier
curl http://unique-bucket-bin.s3.amazonaws.com/commander -o commander
curl http://unique-bucket-bin.s3.amazonaws.com/benchmark -o benchmark
curl http://unique-bucket-bin.s3.amazonaws.com/kill_node.sh -o kill_node.sh
chmod +x ./soldier
chmod +x ./txgen
chmod +x ./benchmark
chmod +x ./commander
chmod +x ./kill_node.sh
# Get My IP
ip=`curl http://169.254.169.254/latest/meta-data/public-ipv4`

Loading…
Cancel
Save