Wonder if we should run this from the sighandler, or just set a flag and let the main loop run this. In the latter case we'd never run this again while it's still running.