Supervisor

This is the first step towards agent auto-updates. The supervisor
regularly checks if the agent is still running and, if not, restarts it.

If it finds an update in an update drop directory specified on the
command line, it will apply it before starting the agent.

Currently, applying an update just means unpacking a zip file to a
specified location.
> For now let's keep the subprocess calls like you have here but I think we want to do something closer to what status in pyfarm-agent does internally in the end. All this will probably mean is pulling some of the code out of status() in the pyfarm-agent script and putting it into a common function that takes some arguments.

Good idea, especially considering that calling a new subprocess is much more heavy-weight than this.

> I think you should consider wrapping os.remove/os.makedirs/zipfile.Zipfile/etc in try blocks or all those statements in a try:except Exception block (include logging of the error either way of course). There's a whole host of issues which could occur (locked files [windows...], disk space, general IO problems, etc) and the way it's setup now it would break out of the loop and the supervisor would exit.

The thing is, what do you want to do with the exception when you catch it? Apart from logging it, there is not much we can do about it. It might actually be better to just let it fall through.