added verbosity to sshsh, and fix make sync so it shows up at the
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 19 Jun 2012 12:23:29 +0000 (14:23 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 19 Jun 2012 12:23:29 +0000 (14:23 +0200)
right place

Makefile
sshsh

index c9e0d91..fb12a5b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -58,7 +58,8 @@ ifeq (,$(NODEURL))
        @echo "  e.g. make sync NODE=vnode01.inria.fr"
        @exit 1
 else
-       +$(RSYNC) ./ $(NODEURL)/usr/share/NodeManager/
+       +$(RSYNC) --exclude sshsh ./ $(NODEURL)/usr/share/NodeManager/
+       +$(RSYNC) ./sshsh $(NODEURL)/bin/
        +$(RSYNC) ./initscripts/nm $(NODEURL)/etc/init.d/nm
        ssh -i $(NODE).key.rsa root@$(NODE) service nm restart
 endif
diff --git a/sshsh b/sshsh
index e80b8ab..dfa03c0 100755 (executable)
--- a/sshsh
+++ b/sshsh
@@ -1,5 +1,21 @@
 #!/bin/bash
+# turn on debugging:
+# either set verbose to true right here
+# or call ssh slice@node -- -v ....
+verbose=
 MAC=$(virsh --connect lxc:// --readonly dumpxml $USER|grep mac|awk -F\' '{print $2}')
 IP=$(cat /var/lib/libvirt/dnsmasq/default.leases | grep $MAC | awk '{print $3}')
 shift
+case "$1" in -v|--verbose) verbose=true; shift ;; esac
+
+if [ -n "$verbose" ]; then
+    echo "sshsh: login=$USER"
+    echo "sshsh: args=>$@<"
+    echo "MAC=>$MAC<"
+    echo "IP=>$IP<"
+    echo "========== beg /var/lib/libvirt/dnsmasq/default.leases"
+    cat /var/lib/libvirt/dnsmasq/default.leases
+    echo "========== end /var/lib/libvirt/dnsmasq/default.leases"
+fi
+
 exec ssh -o StrictHostKeyChecking=no root@$IP "$@"