stripe/einhorn — pull request #14 by ConradIrwin (2012-12-06 18:56:45+00:00)
Title: "wait" command in einhornsh

Hi guys,

This seems like a pretty useful thing to have for two reasons:

1. It's nice if upgrade command doesn't exit until the upgrade is done.
2. It's nice to get an idea of what einhorn is intending (the logs tell you only what it's doing).

In particular I want to integrate the below script into our deploy so that we can see what the problem is if something is taking a surprising amount of time:
```sh
echo "wait upgrade" | einhornsh "$@" & to_wait="$to_wait $!"
tail -f /var/log/app.log & trap "kill $!" EXIT
wait $to_wait
```

(It sounds like something like this would have helped in Issue 2, and this solves Issue 6 to some extent)

Before I had "wait upgrade" I was just looping on einhornsh, and waiting for the number of unique versions to == 1.

That said, it introduces quite a lot of extra clunk to the einhornsh interface, so it may not be the best change to enable this kind of thing. A simpler interface might be to have a "ready" command so that I can loop on 'echo "ready" | einhornsh' instead.

Are you interested in having something like this in Einhorn, and if so, is this a sane implementation, or should I rethink?

Conrad