example 8-10: restarting process on failure