Q:

Easy way to wait for reboot of a host from a script?

I have a script running on machine A that needs to trigger the reboot of machine B and then wait until machine B is fully back up. This actually needs to happen multiple times in succession, so keeping the wait time to a minimum is somewhat important. (It's an automated test of varying boot parameter values.)
These machines are running Linux, so I figure the basic approach should be to install a late-running (e.g. priority 99) init script on machine B that somehow sends a message to machine A. I plan to install the script using update-rc.d ${script_name} start 99 S .. However, where I'm stuck is how to send and wait for the message.
I figure there must be some sort of message queue or coordinator service that I can just script out of the box. For instance, Zookeeper should be capable, though how to script it is surprisingly non-obvious. I could write a little client/server program to do this (presumably using a TCP socket), but I was hoping for a simpler solution. The setup on machine B needs to be done entirely by the script on machine A, so steps like compiling or installing scripting language modules would ideally be avoided.
Thanks for any suggestions!

A:

You could also make a simple network listener using netcat or socat that starts late and the other host repeatedly checks for.  Another way to solve this would be to send an automatic "I'm Alive" message through mail from rc.local to the other machine and pick it up with a script from a .forward or .qmail file.

