pidfile is optional