Wait for process to shut down when restarting