add daemon and pidfile