add syslog, change process to daemon when pidfile provided