First cut at graceful shutdown