You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by id...@apache.org on 2015/04/07 19:29:26 UTC

[1/2] mesos git commit: Eliminate use of 'echo -n'

Repository: mesos
Updated Branches:
  refs/heads/master b99ca4d73 -> fe09d7de7


Eliminate use of 'echo -n'

Review: https://reviews.apache.org/r/32898


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fbfe3fac
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fbfe3fac
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fbfe3fac

Branch: refs/heads/master
Commit: fbfe3facd035d3d372139d1c62f0b30632480956
Parents: b99ca4d
Author: Paul Brett <pa...@twopensource.com>
Authored: Tue Apr 7 10:27:52 2015 -0700
Committer: Ian Downes <id...@twitter.com>
Committed: Tue Apr 7 10:27:52 2015 -0700

----------------------------------------------------------------------
 src/tests/port_mapping_tests.cpp | 42 +++++++++++++++++------------------
 support/timed_tests.sh           |  4 ++--
 2 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fbfe3fac/src/tests/port_mapping_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/port_mapping_tests.cpp b/src/tests/port_mapping_tests.cpp
index 55a5e69..36219e7 100644
--- a/src/tests/port_mapping_tests.cpp
+++ b/src/tests/port_mapping_tests.cpp
@@ -508,13 +508,13 @@ TEST_F(PortMappingIsolatorTest, ROOT_ContainerToContainerTCPTest)
   ostringstream command2;
 
   // Send to 'localhost' and 'port'.
-  command2 << "echo -n hello1 | nc localhost " << port << ";";
+  command2 << "printf hello1 | nc localhost " << port << ";";
   // Send to 'localhost' and 'errorPort'. This should fail.
-  command2 << "echo -n hello2 | nc localhost " << errorPort << ";";
+  command2 << "printf hello2 | nc localhost " << errorPort << ";";
   // Send to 'public IP' and 'port'.
-  command2 << "echo -n hello3 | nc " << hostIP << " " << port << ";";
+  command2 << "printf hello3 | nc " << hostIP << " " << port << ";";
   // Send to 'public IP' and 'errorPort'. This should fail.
-  command2 << "echo -n hello4 | nc " << hostIP << " " << errorPort << ";";
+  command2 << "printf hello4 | nc " << hostIP << " " << errorPort << ";";
   // Touch the guard file.
   command2 << "touch " << container2Ready;
 
@@ -657,13 +657,13 @@ TEST_F(PortMappingIsolatorTest, ROOT_ContainerToContainerUDPTest)
   ostringstream command2;
 
   // Send to 'localhost' and 'port'.
-  command2 << "echo -n hello1 | nc -w1 -u localhost " << port << ";";
+  command2 << "printf hello1 | nc -w1 -u localhost " << port << ";";
   // Send to 'localhost' and 'errorPort'. No data should be sent.
-  command2 << "echo -n hello2 | nc -w1 -u localhost " << errorPort << ";";
+  command2 << "printf hello2 | nc -w1 -u localhost " << errorPort << ";";
   // Send to 'public IP' and 'port'.
-  command2 << "echo -n hello3 | nc -w1 -u " << hostIP << " " << port << ";";
+  command2 << "printf hello3 | nc -w1 -u " << hostIP << " " << port << ";";
   // Send to 'public IP' and 'errorPort'. No data should be sent.
-  command2 << "echo -n hello4 | nc -w1 -u " << hostIP << " " << errorPort
+  command2 << "printf hello4 | nc -w1 -u " << hostIP << " " << errorPort
            << ";";
   // Touch the guard file.
   command2 << "touch " << container2Ready;
@@ -792,24 +792,24 @@ TEST_F(PortMappingIsolatorTest, ROOT_HostToContainerUDPTest)
 
   // Send to 'localhost' and 'port'.
   ostringstream command2;
-  command2 << "echo -n hello1 | nc -w1 -u localhost " << port;
+  command2 << "printf hello1 | nc -w1 -u localhost " << port;
   ASSERT_SOME_EQ(0, os::shell(NULL, command2.str().c_str()));
 
   // Send to 'localhost' and 'errorPort'. The command should return
   // successfully because UDP is stateless but no data could be sent.
   ostringstream command3;
-  command3 << "echo -n hello2 | nc -w1 -u localhost " << errorPort;
+  command3 << "printf hello2 | nc -w1 -u localhost " << errorPort;
   ASSERT_SOME_EQ(0, os::shell(NULL, command3.str().c_str()));
 
   // Send to 'public IP' and 'port'.
   ostringstream command4;
-  command4 << "echo -n hello3 | nc -w1 -u " << hostIP << " " << port;
+  command4 << "printf hello3 | nc -w1 -u " << hostIP << " " << port;
   ASSERT_SOME_EQ(0, os::shell(NULL, command4.str().c_str()));
 
   // Send to 'public IP' and 'errorPort'. The command should return
   // successfully because UDP is stateless but no data could be sent.
   ostringstream command5;
-  command5 << "echo -n hello4 | nc -w1 -u " << hostIP << " " << errorPort;
+  command5 << "printf hello4 | nc -w1 -u " << hostIP << " " << errorPort;
   ASSERT_SOME_EQ(0, os::shell(NULL, command5.str().c_str()));
 
   EXPECT_SOME_EQ("hello1", os::read(trafficViaLoopback));
@@ -902,24 +902,24 @@ TEST_F(PortMappingIsolatorTest, ROOT_HostToContainerTCPTest)
 
   // Send to 'localhost' and 'port'.
   ostringstream command2;
-  command2 << "echo -n hello1 | nc localhost " << port;
+  command2 << "printf hello1 | nc localhost " << port;
   ASSERT_SOME_EQ(0, os::shell(NULL, command2.str().c_str()));
 
   // Send to 'localhost' and 'errorPort'. This should fail because TCP
   // connection couldn't be established..
   ostringstream command3;
-  command3 << "echo -n hello2 | nc localhost " << errorPort;
+  command3 << "printf hello2 | nc localhost " << errorPort;
   ASSERT_SOME_EQ(256, os::shell(NULL, command3.str().c_str()));
 
   // Send to 'public IP' and 'port'.
   ostringstream command4;
-  command4 << "echo -n hello3 | nc " << hostIP << " " << port;
+  command4 << "printf hello3 | nc " << hostIP << " " << port;
   ASSERT_SOME_EQ(0, os::shell(NULL, command4.str().c_str()));
 
   // Send to 'public IP' and 'errorPort'. This should fail because TCP
   // connection couldn't be established.
   ostringstream command5;
-  command5 << "echo -n hello4 | nc " << hostIP << " " << errorPort;
+  command5 << "printf hello4 | nc " << hostIP << " " << errorPort;
   ASSERT_SOME_EQ(256, os::shell(NULL, command5.str().c_str()));
 
   EXPECT_SOME_EQ("hello1", os::read(trafficViaLoopback));
@@ -981,7 +981,7 @@ TEST_F(PortMappingIsolatorTest, ROOT_ContainerICMPExternalTest)
       command1 << " && ";
     }
   }
-  command1 << "; echo -n $? > " << exitStatus << "; sync";
+  command1 << "; printf $? > " << exitStatus << "; sync";
 
   int pipes[2];
   ASSERT_NE(-1, ::pipe(pipes));
@@ -1054,8 +1054,8 @@ TEST_F(PortMappingIsolatorTest, ROOT_ContainerICMPInternalTest)
   ASSERT_SOME(preparation1.get());
 
   ostringstream command1;
-  command1 << "ping -c1 127.0.0.1 && ping -c1 " << hostIP << "; echo -n $? > "
-           << exitStatus << "; sync";
+  command1 << "ping -c1 127.0.0.1 && ping -c1 " << hostIP
+           << "; printf $? > " << exitStatus << "; sync";
 
   int pipes[2];
   ASSERT_NE(-1, ::pipe(pipes));
@@ -1145,7 +1145,7 @@ TEST_F(PortMappingIsolatorTest, ROOT_ContainerARPExternalTest)
       command1 << " && ";
     }
   }
-  command1 << "; echo -n $? > " << exitStatus << "; sync";
+  command1 << "; printf $? > " << exitStatus << "; sync";
 
   int pipes[2];
   ASSERT_NE(-1, ::pipe(pipes));
@@ -1233,7 +1233,7 @@ TEST_F(PortMappingIsolatorTest, ROOT_DNSTest)
       command1 << " && ";
     }
   }
-  command1 << "; echo -n $? > " << exitStatus << "; sync";
+  command1 << "; printf $? > " << exitStatus << "; sync";
 
   int pipes[2];
   ASSERT_NE(-1, ::pipe(pipes));

http://git-wip-us.apache.org/repos/asf/mesos/blob/fbfe3fac/support/timed_tests.sh
----------------------------------------------------------------------
diff --git a/support/timed_tests.sh b/support/timed_tests.sh
index 5e01af9..37e30ef 100755
--- a/support/timed_tests.sh
+++ b/support/timed_tests.sh
@@ -34,7 +34,7 @@ duration=$2
 
 echo "This script runs with session id $$ and can be terminated by: pkill -s $$"
 
-echo -n `date`; echo ": start running $test_cmd"
+printf "$(date)"; echo ": start running $test_cmd"
 
 start=$(date +"%s")
 eval $test_cmd &
@@ -55,7 +55,7 @@ while [ $(($(date +"%s") - $start)) -lt $duration ]; do
   sleep 5
 done
 
-echo -n `date`; echo ": process still running after $duration seconds"
+printf "$(date)"; echo ": process still running after $duration seconds"
 
 tmp=`mktemp XXXXX`
 echo "thread apply all bt" > $tmp


[2/2] mesos git commit: Eliminate the use of 'echo -n' in EC2 scripts

Posted by id...@apache.org.
Eliminate the use of 'echo -n' in EC2 scripts

Review: https://reviews.apache.org/r/32903


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fe09d7de
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fe09d7de
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fe09d7de

Branch: refs/heads/master
Commit: fe09d7de7f84de82f447d4321fe89912c06e402c
Parents: fbfe3fa
Author: Paul Brett <pa...@twopensource.com>
Authored: Tue Apr 7 10:28:07 2015 -0700
Committer: Ian Downes <id...@twitter.com>
Committed: Tue Apr 7 10:28:07 2015 -0700

----------------------------------------------------------------------
 ec2/deploy.amazon64-old/root/mesos-ec2/hypertable/Capfile |  2 +-
 ec2/deploy.amazon64-old/root/mesos-ec2/setup              | 10 +++++-----
 ec2/deploy.amazon64/root/mesos-ec2/hypertable/Capfile     |  2 +-
 ec2/deploy.amazon64/root/mesos-ec2/setup                  | 10 +++++-----
 ec2/deploy.centos64/root/mesos-ec2/hypertable/Capfile     |  2 +-
 ec2/deploy.centos64/root/mesos-ec2/setup                  | 10 +++++-----
 ec2/deploy.lucid64/root/mesos-ec2/setup                   | 10 +++++-----
 7 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fe09d7de/ec2/deploy.amazon64-old/root/mesos-ec2/hypertable/Capfile
----------------------------------------------------------------------
diff --git a/ec2/deploy.amazon64-old/root/mesos-ec2/hypertable/Capfile b/ec2/deploy.amazon64-old/root/mesos-ec2/hypertable/Capfile
index 8b50912..fd5921e 100644
--- a/ec2/deploy.amazon64-old/root/mesos-ec2/hypertable/Capfile
+++ b/ec2/deploy.amazon64-old/root/mesos-ec2/hypertable/Capfile
@@ -416,7 +416,7 @@ if "#{test_driver}" == "hypertable"
   set :run_test_dispatcher_command, "#{install_dir}/current/bin/jrun --pidfile #{install_dir}/#{hypertable_version}/run/Hypertable.TestDispatcher.pid org.hypertable.examples.PerformanceTest.Dispatcher --driver=#{test_driver} --clients=#{roles[:test_client].servers.length*client_multiplier} #{test_args}"
   set :stop_test_args, ""
 elsif "#{test_driver}" == "hbase"
-  set :thrift_broker_command, "echo -n"
+  set :thrift_broker_command, "true"
   set :start_test_client_command, "#{install_dir}/current/bin/start-test-client.sh --jrun-opts \"--add-to-classpath #{hbase_home}/conf\" --count #{client_multiplier} #{roles[:test_dispatcher].servers[0]}"
   set :run_test_dispatcher_command, "#{install_dir}/current/bin/jrun --pidfile #{install_dir}/#{hypertable_version}/run/Hypertable.TestDispatcher.pid --add-to-classpath #{hbase_home}/conf org.hypertable.examples.PerformanceTest.Dispatcher --driver=#{test_driver} --clients=#{roles[:test_client].servers.length*client_multiplier} #{test_args}"
   set :stop_test_args, "--no-thriftbroker --no-dfsbroker"

http://git-wip-us.apache.org/repos/asf/mesos/blob/fe09d7de/ec2/deploy.amazon64-old/root/mesos-ec2/setup
----------------------------------------------------------------------
diff --git a/ec2/deploy.amazon64-old/root/mesos-ec2/setup b/ec2/deploy.amazon64-old/root/mesos-ec2/setup
index 8d4f4b0..2165f90 100755
--- a/ec2/deploy.amazon64-old/root/mesos-ec2/setup
+++ b/ec2/deploy.amazon64-old/root/mesos-ec2/setup
@@ -67,11 +67,11 @@ echo "Running setup-slave on master to mount filesystems, etc..."
 echo "SSH'ing to master machine(s) to approve key(s)..."
 for master in $MASTERS; do
   echo $master
-  ssh $SSH_OPTS $master echo -n &
+  ssh $SSH_OPTS $master true &
   sleep 0.3
 done
-ssh $SSH_OPTS localhost echo -n &
-ssh $SSH_OPTS `hostname` echo -n &
+ssh $SSH_OPTS localhost true &
+ssh $SSH_OPTS `hostname` true &
 wait
 
 if [[ $NUM_ZOOS != 0 ]] ; then
@@ -79,7 +79,7 @@ if [[ $NUM_ZOOS != 0 ]] ; then
   zid=1
   for zoo in $ZOO; do
     echo $zoo
-    ssh $SSH_OPTS $zoo echo -n \; mkdir -p /tmp/zookeeper \; echo $zid \> /tmp/zookeeper/myid &
+    ssh $SSH_OPTS $zoo true \; mkdir -p /tmp/zookeeper \; echo $zid \> /tmp/zookeeper/myid &
     zid=$(($zid+1))
     sleep 0.3
   done
@@ -94,7 +94,7 @@ while [ "e$TODO" != "e" ] && [ $TRIES -lt 4 ] ; do
   NEW_TODO=
   for slave in $TODO; do
     echo $slave
-    ssh $SSH_OPTS $slave echo -n
+    ssh $SSH_OPTS $slave true
     if [ $? != 0 ] ; then
         NEW_TODO="$NEW_TODO $slave"
     fi

http://git-wip-us.apache.org/repos/asf/mesos/blob/fe09d7de/ec2/deploy.amazon64/root/mesos-ec2/hypertable/Capfile
----------------------------------------------------------------------
diff --git a/ec2/deploy.amazon64/root/mesos-ec2/hypertable/Capfile b/ec2/deploy.amazon64/root/mesos-ec2/hypertable/Capfile
index 8b50912..fd5921e 100644
--- a/ec2/deploy.amazon64/root/mesos-ec2/hypertable/Capfile
+++ b/ec2/deploy.amazon64/root/mesos-ec2/hypertable/Capfile
@@ -416,7 +416,7 @@ if "#{test_driver}" == "hypertable"
   set :run_test_dispatcher_command, "#{install_dir}/current/bin/jrun --pidfile #{install_dir}/#{hypertable_version}/run/Hypertable.TestDispatcher.pid org.hypertable.examples.PerformanceTest.Dispatcher --driver=#{test_driver} --clients=#{roles[:test_client].servers.length*client_multiplier} #{test_args}"
   set :stop_test_args, ""
 elsif "#{test_driver}" == "hbase"
-  set :thrift_broker_command, "echo -n"
+  set :thrift_broker_command, "true"
   set :start_test_client_command, "#{install_dir}/current/bin/start-test-client.sh --jrun-opts \"--add-to-classpath #{hbase_home}/conf\" --count #{client_multiplier} #{roles[:test_dispatcher].servers[0]}"
   set :run_test_dispatcher_command, "#{install_dir}/current/bin/jrun --pidfile #{install_dir}/#{hypertable_version}/run/Hypertable.TestDispatcher.pid --add-to-classpath #{hbase_home}/conf org.hypertable.examples.PerformanceTest.Dispatcher --driver=#{test_driver} --clients=#{roles[:test_client].servers.length*client_multiplier} #{test_args}"
   set :stop_test_args, "--no-thriftbroker --no-dfsbroker"

http://git-wip-us.apache.org/repos/asf/mesos/blob/fe09d7de/ec2/deploy.amazon64/root/mesos-ec2/setup
----------------------------------------------------------------------
diff --git a/ec2/deploy.amazon64/root/mesos-ec2/setup b/ec2/deploy.amazon64/root/mesos-ec2/setup
index b6b7360..c69f7da 100755
--- a/ec2/deploy.amazon64/root/mesos-ec2/setup
+++ b/ec2/deploy.amazon64/root/mesos-ec2/setup
@@ -67,11 +67,11 @@ echo "Running setup-slave on master to mount filesystems, etc..."
 echo "SSH'ing to master machine(s) to approve key(s)..."
 for master in $MASTERS; do
   echo $master
-  ssh $SSH_OPTS $master echo -n &
+  ssh $SSH_OPTS $master true &
   sleep 0.3
 done
-ssh $SSH_OPTS localhost echo -n &
-ssh $SSH_OPTS `hostname` echo -n &
+ssh $SSH_OPTS localhost true &
+ssh $SSH_OPTS `hostname` true &
 wait
 
 if [[ $NUM_ZOOS != 0 ]] ; then
@@ -79,7 +79,7 @@ if [[ $NUM_ZOOS != 0 ]] ; then
   zid=1
   for zoo in $ZOO; do
     echo $zoo
-    ssh $SSH_OPTS $zoo echo -n \; mkdir -p /tmp/zookeeper \; echo $zid \> /tmp/zookeeper/myid &
+    ssh $SSH_OPTS $zoo true \; mkdir -p /tmp/zookeeper \; echo $zid \> /tmp/zookeeper/myid &
     zid=$(($zid+1))
     sleep 0.3
   done
@@ -94,7 +94,7 @@ while [ "e$TODO" != "e" ] && [ $TRIES -lt 4 ] ; do
   NEW_TODO=
   for slave in $TODO; do
     echo $slave
-    ssh $SSH_OPTS $slave echo -n
+    ssh $SSH_OPTS $slave true
     if [ $? != 0 ] ; then
         NEW_TODO="$NEW_TODO $slave"
     fi

http://git-wip-us.apache.org/repos/asf/mesos/blob/fe09d7de/ec2/deploy.centos64/root/mesos-ec2/hypertable/Capfile
----------------------------------------------------------------------
diff --git a/ec2/deploy.centos64/root/mesos-ec2/hypertable/Capfile b/ec2/deploy.centos64/root/mesos-ec2/hypertable/Capfile
index f85584a..e309971 100644
--- a/ec2/deploy.centos64/root/mesos-ec2/hypertable/Capfile
+++ b/ec2/deploy.centos64/root/mesos-ec2/hypertable/Capfile
@@ -379,7 +379,7 @@ if "#{test_driver}" == "hypertable"
   set :run_test_dispatcher_command, "#{install_dir}/current/bin/jrun --pidfile #{install_dir}/#{hypertable_version}/run/Hypertable.TestDispatcher.pid org.hypertable.examples.PerformanceTest.Dispatcher --driver=#{test_driver} --clients=#{roles[:test_client].servers.length*client_multiplier} #{test_args}"
   set :stop_test_args, ""
 elsif "#{test_driver}" == "hbase"
-  set :thrift_broker_command, "echo -n"
+  set :thrift_broker_command, "true"
   set :start_test_client_command, "#{install_dir}/current/bin/start-test-client.sh --jrun-opts \"--add-to-classpath #{hbase_home}/conf\" --count #{client_multiplier} #{roles[:test_dispatcher].servers[0]}"
   set :run_test_dispatcher_command, "#{install_dir}/current/bin/jrun --pidfile #{install_dir}/#{hypertable_version}/run/Hypertable.TestDispatcher.pid --add-to-classpath #{hbase_home}/conf org.hypertable.examples.PerformanceTest.Dispatcher --driver=#{test_driver} --clients=#{roles[:test_client].servers.length*client_multiplier} #{test_args}"
   set :stop_test_args, "--no-thriftbroker --no-dfsbroker"

http://git-wip-us.apache.org/repos/asf/mesos/blob/fe09d7de/ec2/deploy.centos64/root/mesos-ec2/setup
----------------------------------------------------------------------
diff --git a/ec2/deploy.centos64/root/mesos-ec2/setup b/ec2/deploy.centos64/root/mesos-ec2/setup
index f380f7a..f06ed21 100755
--- a/ec2/deploy.centos64/root/mesos-ec2/setup
+++ b/ec2/deploy.centos64/root/mesos-ec2/setup
@@ -67,11 +67,11 @@ echo "Running setup-slave on master to mount filesystems, etc..."
 echo "SSH'ing to master machine(s) to approve key(s)..."
 for master in $MASTERS; do
   echo $master
-  ssh $SSH_OPTS $master echo -n &
+  ssh $SSH_OPTS $master true &
   sleep 0.3
 done
-ssh $SSH_OPTS localhost echo -n &
-ssh $SSH_OPTS `hostname` echo -n &
+ssh $SSH_OPTS localhost true &
+ssh $SSH_OPTS `hostname` true &
 wait
 
 if [[ $NUM_ZOOS != 0 ]] ; then
@@ -79,7 +79,7 @@ if [[ $NUM_ZOOS != 0 ]] ; then
   zid=1
   for zoo in $ZOO; do
     echo $zoo
-    ssh $SSH_OPTS $zoo echo -n \; mkdir -p /tmp/zookeeper \; echo $zid \> /tmp/zookeeper/myid &
+    ssh $SSH_OPTS $zoo true \; mkdir -p /tmp/zookeeper \; echo $zid \> /tmp/zookeeper/myid &
     zid=$(($zid+1))
     sleep 0.3
   done
@@ -94,7 +94,7 @@ while [ "e$TODO" != "e" ] && [ $TRIES -lt 4 ] ; do
   NEW_TODO=
   for slave in $TODO; do
     echo $slave
-    ssh $SSH_OPTS $slave echo -n
+    ssh $SSH_OPTS $slave true
     if [ $? != 0 ] ; then
         NEW_TODO="$NEW_TODO $slave"
     fi

http://git-wip-us.apache.org/repos/asf/mesos/blob/fe09d7de/ec2/deploy.lucid64/root/mesos-ec2/setup
----------------------------------------------------------------------
diff --git a/ec2/deploy.lucid64/root/mesos-ec2/setup b/ec2/deploy.lucid64/root/mesos-ec2/setup
index 0a74757..cd11d65 100755
--- a/ec2/deploy.lucid64/root/mesos-ec2/setup
+++ b/ec2/deploy.lucid64/root/mesos-ec2/setup
@@ -63,11 +63,11 @@ echo "Running setup-slave on master to mount filesystems, etc..."
 echo "SSH'ing to master machine(s) to approve key(s)..."
 for master in $MASTERS; do
   echo $master
-  ssh $SSH_OPTS $master echo -n &
+  ssh $SSH_OPTS $master true &
   sleep 0.3
 done
-ssh $SSH_OPTS localhost echo -n &
-ssh $SSH_OPTS `hostname` echo -n &
+ssh $SSH_OPTS localhost true &
+ssh $SSH_OPTS `hostname` true &
 wait
 
 if [[ $NUM_ZOOS != 0 ]] ; then
@@ -75,7 +75,7 @@ if [[ $NUM_ZOOS != 0 ]] ; then
   zid=1
   for zoo in $ZOO; do
     echo $zoo
-    ssh $SSH_OPTS $zoo echo -n \; mkdir -p /tmp/zookeeper \; echo $zid \> /tmp/zookeeper/myid &
+    ssh $SSH_OPTS $zoo true \; mkdir -p /tmp/zookeeper \; echo $zid \> /tmp/zookeeper/myid &
     zid=$(($zid+1))
     sleep 0.3
   done
@@ -90,7 +90,7 @@ while [ "e$TODO" != "e" ] && [ $TRIES -lt 4 ] ; do
   NEW_TODO=
   for slave in $TODO; do
     echo $slave
-    ssh $SSH_OPTS $slave echo -n
+    ssh $SSH_OPTS $slave true
     if [ $? != 0 ] ; then
         NEW_TODO="$NEW_TODO $slave"
     fi