From: Timo Sirainen Date: Mon, 15 Nov 2010 17:03:52 +0000 (+0000) Subject: "Running standalone?" check now uses a new DOVECOT_CHILD_PROCESS environment rather... X-Git-Tag: 2.0.8~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d482079eb385cd071bbc9637cacee225e4aff968;p=thirdparty%2Fdovecot%2Fcore.git "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. --- diff --git a/src/imap/main.c b/src/imap/main.c index 7a9d757021..1291add1e8 100644 --- a/src/imap/main.c +++ b/src/imap/main.c @@ -24,7 +24,7 @@ #include #define IS_STANDALONE() \ - (getenv(MASTER_UID_ENV) == NULL) + (getenv(MASTER_IS_PARENT_ENV) == NULL) #define IMAP_DIE_IDLE_SECS 10 diff --git a/src/lib-master/master-interface.h b/src/lib-master/master-interface.h index f595bd2e12..005abc5e87 100644 --- a/src/lib-master/master-interface.h +++ b/src/lib-master/master-interface.h @@ -33,6 +33,10 @@ enum master_login_state { 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 @@ enum master_login_state { /* 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, diff --git a/src/lmtp/main.c b/src/lmtp/main.c index ead45bd3ed..17957f3456 100644 --- a/src/lmtp/main.c +++ b/src/lmtp/main.c @@ -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; diff --git a/src/master/service-process.c b/src/master/service-process.c index fc589a8d94..203179a52d 100644 --- a/src/master/service-process.c +++ b/src/master/service-process.c @@ -207,6 +207,7 @@ service_process_setup_environment(struct service *service, unsigned int uid) 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) { diff --git a/src/pop3/main.c b/src/pop3/main.c index afb49a6c3c..846b4a8637 100644 --- a/src/pop3/main.c +++ b/src/pop3/main.c @@ -22,7 +22,7 @@ #include #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; diff --git a/src/util/script-login.c b/src/util/script-login.c index d93544580a..e1ca3a62ed 100644 --- a/src/util/script-login.c +++ b/src/util/script-login.c @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) 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,