Permalink
Browse files

event.d/*: Add some debug info

  • Loading branch information...
1 parent 31ad49f commit 159f1b09b114e3216070a2450de1726b96aee197 @jonanh jonanh committed Mar 20, 2012
@@ -11,13 +11,14 @@ if [ -n "${mac}" ]; then
case ${action} in
register)
if [ -n "${hostname}" ]; then
-
- # Remove any old entry
- sed -ri "/${mac}/d" ${KESTREL_REG_NODES}
-
- # Add the new entry
- echo "${mac},${hostname}" >> ${KESTREL_REG_NODES}
-
+ echo "registering node"
+
+ # Remove any old entry
+ sed -ri "/${mac}/d" ${KESTREL_REG_NODES}
+
+ # Add the new entry
+ echo "${mac},${hostname}" >> ${KESTREL_REG_NODES}
+
fi
;;
@@ -8,21 +8,23 @@ if [ -n "${hostname}" ]; then
case ${action} in
connect|register)
+ # Update known hosts files
sed -ri "/^${hostname}[[:space:]]/d" /etc/ssh/ssh_known_hosts
list_users | while read user; do
[ -e /home/${user}/.ssh/known_hosts ] &&
- sed -ri "/^${hostname}[[:space:]]/d" \
- /home/${user}/.ssh/known_hosts
+ sed -ri "/^${hostname}[[:space:]]/d" /home/${user}/.ssh/known_hosts
done
-
+
key=$(awk '{print $2}' \
${KESTREL_IMAGE_DIR}/${image}/etc/ssh/ssh_host_rsa_key.pub)
echo "${hostname} ssh-rsa ${key}" >> /etc/ssh/ssh_known_hosts
unset SSH_AUTH_SOCK
+ echo "su kestrel -c 'ssh \"${hostname}\" sudo set_hostname \"${hostname}\" \"${FRONTEND_IP}\" \"$(hostname)\"'"
+
su kestrel -c "ssh ${hostname} sudo set_hostname ${hostname} ${FRONTEND_IP} $(hostname)"
;;
@@ -2,10 +2,10 @@
if [[ "${action}" == @(halt|reboot) ]]; then
- echo "ssh shutdown"
-
unset SSH_AUTH_SOCK
+ echo "su kestrel -c 'ssh \"${host}\" sudo \"${op}\"'"
+
# FIXME Hack to avoid something I don't remember now
su kestrel -c "ssh ${host} sudo ${op}" 2> /dev/null || {
warn "\tUnable to ${op} ${host} (ip:${ip})"; fail=True; } &
@@ -2,6 +2,8 @@
if [ "${action}" == "wake" ]; then
+ echo "etherwake -i \"${KESTREL_IFACE}\" \"${mac}\""
+
# $KESTREL_IFACE is exported by check_kestrel_daemon function
etherwake -i "${KESTREL_IFACE}" "${mac}" > /dev/null ||
warn "Wol failed"

0 comments on commit 159f1b0

Please sign in to comment.