add -d -f -h cmd options
make sure configuration path is absolute
run as daemon if -d specified