When we detach, we replace stderr by /dev/null, so there's no point in
logging to the console after that. Just turn it off.
dup2(null_fd, STDOUT_FILENO);
dup2(null_fd, STDERR_FILENO);
}
dup2(null_fd, STDOUT_FILENO);
dup2(null_fd, STDERR_FILENO);
}
+
+ /* Disable logging to stderr to avoid wasting CPU time. */
+ vlog_set_levels(NULL, VLF_CONSOLE, VLL_EMER);
}
/* If daemonization is configured, then starts daemonization, by forking and
}
/* If daemonization is configured, then starts daemonization, by forking and