Mercurial > dovecot > core-2.2
changeset 12425:10c163bb5e22
"Running standalone?" check now uses a new DOVECOT_CHILD_PROCESS environment rather than GENERATION.
The GENERATION environment was already set in some systems for Java.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 15 Nov 2010 17:03:52 +0000 |
parents | 172942ae0b58 |
children | 3aced5ececd7 |
files | src/imap/main.c src/lib-master/master-interface.h src/lmtp/main.c src/master/service-process.c src/pop3/main.c src/util/script-login.c |
diffstat | 6 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/imap/main.c Mon Nov 15 16:49:26 2010 +0000 +++ b/src/imap/main.c Mon Nov 15 17:03:52 2010 +0000 @@ -24,7 +24,7 @@ #include <unistd.h> #define IS_STANDALONE() \ - (getenv(MASTER_UID_ENV) == NULL) + (getenv(MASTER_IS_PARENT_ENV) == NULL) #define IMAP_DIE_IDLE_SECS 10
--- a/src/lib-master/master-interface.h Mon Nov 15 16:49:26 2010 +0000 +++ b/src/lib-master/master-interface.h Mon Nov 15 17:03:52 2010 +0000 @@ -33,6 +33,10 @@ MASTER_LOGIN_STATE_FULL }; +/* getenv(MASTER_IS_PARENT_ENV) != NULL if process was started by + Dovecot master */ +#define MASTER_IS_PARENT_ENV "DOVECOT_CHILD_PROCESS" + /* getenv(MASTER_UID_ENV) provides master_status.uid value */ #define MASTER_UID_ENV "GENERATION" @@ -47,7 +51,8 @@ /* getenv(MASTER_CONFIG_FILE_ENV) provides path to configuration file/socket */ #define MASTER_CONFIG_FILE_ENV "CONFIG_FILE" -/* getenv(MASTER_DOVECOT_VERSION_ENV) provides master's version number */ +/* getenv(MASTER_DOVECOT_VERSION_ENV) provides master's version number + (unset if version_ignore=yes) */ #define MASTER_DOVECOT_VERSION_ENV "DOVECOT_VERSION" /* getenv(MASTER_SSL_KEY_PASSWORD_ENV) returns manually typed SSL key password,
--- a/src/lmtp/main.c Mon Nov 15 16:49:26 2010 +0000 +++ b/src/lmtp/main.c Mon Nov 15 17:03:52 2010 +0000 @@ -23,7 +23,7 @@ #define LMTP_MASTER_FIRST_LISTEN_FD 3 #define IS_STANDALONE() \ - (getenv(MASTER_UID_ENV) == NULL) + (getenv(MASTER_IS_PARENT_ENV) == NULL) const char *dns_client_socket_path; struct mail_storage_service_ctx *storage_service;
--- a/src/master/service-process.c Mon Nov 15 16:49:26 2010 +0000 +++ b/src/master/service-process.c Mon Nov 15 17:03:52 2010 +0000 @@ -207,6 +207,7 @@ break; } + env_put(MASTER_IS_PARENT_ENV"=1"); env_put(t_strdup_printf(MASTER_CLIENT_LIMIT_ENV"=%u", service->client_limit)); if (service->set->service_count != 0) {
--- a/src/pop3/main.c Mon Nov 15 16:49:26 2010 +0000 +++ b/src/pop3/main.c Mon Nov 15 17:03:52 2010 +0000 @@ -22,7 +22,7 @@ #include <unistd.h> #define IS_STANDALONE() \ - (getenv(MASTER_UID_ENV) == NULL) + (getenv(MASTER_IS_PARENT_ENV) == NULL) static bool verbose_proctitle = FALSE; static struct mail_storage_service_ctx *storage_service;
--- a/src/util/script-login.c Mon Nov 15 16:49:26 2010 +0000 +++ b/src/util/script-login.c Mon Nov 15 17:03:52 2010 +0000 @@ -182,7 +182,7 @@ enum master_service_flags flags = 0; int i, c; - if (getenv(MASTER_UID_ENV) == NULL) + if (getenv(MASTER_IS_PARENT_ENV) == NULL) flags |= MASTER_SERVICE_FLAG_STANDALONE; master_service = master_service_init("script-login", flags,