Made configuration occur after daemonization

If daemonization is done after configuration it closes open log files