CTDB doesn't want this redirection of stderr to the log file. It
expects to be able to capture stderr of subprocesses and log them with
a header. This redirection stops that from happening.
Unfortunately this has to be a negative option (i.e. "no" in the name)
so that the default of 0/false maintains existing behaviour.
Note that the default behaviour is sub-optimal because it causes raw
data (i.e. debug data without a header) to appear in the log.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15090
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
* If log file was opened or created successfully, take over stderr to
* catch output into logs.
*/
- if (dbgc_config[DBGC_ALL].fd > 0) {
+ if (!state.settings.debug_no_stderr_redirect &&
+ dbgc_config[DBGC_ALL].fd > 0) {
if (dup2(dbgc_config[DBGC_ALL].fd, 2) == -1) {
/* Close stderr too, if dup2 can't point it -
at the logfile. There really isn't much
bool debug_pid;
bool debug_uid;
bool debug_class;
+ bool debug_no_stderr_redirect;
};
void setup_logging(const char *prog_name, enum debug_logtype new_logtype);