From: Timo Sirainen Date: Fri, 20 Aug 2010 19:12:51 +0000 (+0100) Subject: master: Fixed log_path=/dev/stderr X-Git-Tag: 2.0.1~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b955a1c1b6d466977d971c029a9305bee492f73c;p=thirdparty%2Fdovecot%2Fcore.git master: Fixed log_path=/dev/stderr --- diff --git a/src/master/service-process.c b/src/master/service-process.c index 3575081588..fc589a8d94 100644 --- a/src/master/service-process.c +++ b/src/master/service-process.c @@ -117,7 +117,11 @@ service_dup_fds(struct service *service) } dup2_append(&dups, service->status_fd[1], MASTER_STATUS_FD); - if (service->type != SERVICE_TYPE_LOG) { + if (service->type == SERVICE_TYPE_LOG) { + /* keep stderr as-is. this is especially important when + log_path=/dev/stderr, but might be helpful even in other + situations for logging startup errors */ + } else { /* set log file to stderr. dup2() here immediately so that we can set up logging to it without causing any log messages to be lost. */ @@ -127,8 +131,6 @@ service_dup_fds(struct service *service) if (dup2(service->log_fd[1], STDERR_FILENO) < 0) i_fatal("dup2(log fd) failed: %m"); i_set_failure_internal(); - } else { - dup2_append(&dups, null_fd, STDERR_FILENO); } /* make sure we don't leak syslog fd. try to do it as late as possible,