Mercurial > dovecot > core-2.2
changeset 9345:0dbc2dc0877c HEAD
master process shouldn't log to stderr. Changed the lib-master flag to _DONT_LOG_TO_STDERR.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 21 May 2009 14:39:55 -0400 |
parents | d6eda52bd74b |
children | cf3f5258d47f |
files | src/lib-master/master-service.c src/lib-master/master-service.h src/master/main.c src/util/doveadm.c |
diffstat | 4 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-master/master-service.c Thu May 21 12:59:30 2009 -0400 +++ b/src/lib-master/master-service.c Thu May 21 14:39:55 2009 -0400 @@ -108,7 +108,6 @@ service->socket_count = 1; } else { service->version_string = PACKAGE_VERSION; - service->flags |= MASTER_SERVICE_FLAG_LOG_TO_STDERR; } str = getenv("SOCKET_COUNT"); if (str != NULL) @@ -137,7 +136,8 @@ { const char *path; - if ((service->flags & MASTER_SERVICE_FLAG_LOG_TO_STDERR) != 0) { + if ((service->flags & MASTER_SERVICE_FLAG_STANDALONE) != 0 && + (service->flags & MASTER_SERVICE_FLAG_DONT_LOG_TO_STDERR) == 0) { i_set_failure_file("/dev/stderr", ""); return; }
--- a/src/lib-master/master-service.h Thu May 21 12:59:30 2009 -0400 +++ b/src/lib-master/master-service.h Thu May 21 14:39:55 2009 -0400 @@ -8,8 +8,9 @@ MASTER_SERVICE_FLAG_STD_CLIENT = 0x01, /* this process is currently running standalone without a master */ MASTER_SERVICE_FLAG_STANDALONE = 0x02, - /* Log to stderr instead of the configured log file */ - MASTER_SERVICE_FLAG_LOG_TO_STDERR = 0x04, + /* Log to configured log file instead of stderr. By default when + _FLAG_STANDALONE is set, logging is done to stderr. */ + MASTER_SERVICE_FLAG_DONT_LOG_TO_STDERR = 0x04, /* Service is going to do multiple configuration lookups, keep the connection to config service open. */ MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN = 0x08
--- a/src/master/main.c Thu May 21 12:59:30 2009 -0400 +++ b/src/master/main.c Thu May 21 14:39:55 2009 -0400 @@ -569,7 +569,10 @@ else child_process_env[child_process_env_idx++] = "GDB=1"; #endif - master_service = master_service_init("master", 0, argc, argv); + master_service = master_service_init("master", + MASTER_SERVICE_FLAG_STANDALONE | + MASTER_SERVICE_FLAG_DONT_LOG_TO_STDERR, + argc, argv); i_set_failure_prefix(""); master_uid = geteuid();
--- a/src/util/doveadm.c Thu May 21 12:59:30 2009 -0400 +++ b/src/util/doveadm.c Thu May 21 14:39:55 2009 -0400 @@ -213,9 +213,7 @@ bool all_users = FALSE; int c; - service = master_service_init("doveadm", - MASTER_SERVICE_FLAG_STANDALONE | - MASTER_SERVICE_FLAG_LOG_TO_STDERR, + service = master_service_init("doveadm", MASTER_SERVICE_FLAG_STANDALONE, argc, argv); username = getenv("USER");