rework daemonization, export enable variables and add checks for them