support daemonize and pidfile