Makes debug.log respect config.log.logrotate.
Closes bz#236.
Signed-off-by: Tobias Ulmer <tu@emlix.com>
         e2lib.abort(re)
     end
 
-    rc, re = opendebuglogfile()
+    -- load e2.conf and do basic initialization
+    rc, re = e2lib.init2()
     if not rc then
-        return false, e:cat(re)
+        return false, re
     end
 
-    rc, re = e2lib.init2() -- configuration must be available
+    -- open debug.log after config.log.logrotate has come into effect
+    rc, re = opendebuglogfile()
     if not rc then
-        return false, re
+        return false, e:cat(re)
     end
 
     if skip_load_config == true then