Add an option to write a pidfile.