Add options to daemonize and create error log