The virFork call resets all logging handlers that may have been
set. Re-enable them after fork in virExec, so that env variables
fir LIBVIRT_LOG_OUTPUTS and LIBVIRT_LOG_FILTERS take effect
until the execve()
* src/util/util.c: Preserve logging in child in virExec
childout = -1;
}
+ /* Initialize full logging for a while */
+ virLogSetFromEnv();
+
/* Daemonize as late as possible, so the parent process can detect
* the above errors with wait* */
if (flags & VIR_EXEC_DAEMON) {
virClearCapabilities() < 0)
goto fork_error;
+ /* Close logging again to ensure no FDs leak to child */
+ virLogReset();
+
if (envp)
execve(argv[0], (char **) argv, (char**)envp);
else