Wrap a long process with a pidfile without forking