Better handling of pidfile, and process owner.