Added 'generatePID' option that creates a pid file for the process, in case it's not a background process.