dovecot-2.0: "Running standalone?" check now uses a new DOVECOT_...

dovecot at dovecot.org dovecot at dovecot.org
Mon Nov 15 19:03:56 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/10c163bb5e22
changeset: 12425:10c163bb5e22
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Nov 15 17:03:52 2010 +0000
description:
"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.

diffstat:

 src/imap/main.c                   |  2 +-
 src/lib-master/master-interface.h |  7 ++++++-
 src/lmtp/main.c                   |  2 +-
 src/master/service-process.c      |  1 +
 src/pop3/main.c                   |  2 +-
 src/util/script-login.c           |  2 +-
 6 files changed, 11 insertions(+), 5 deletions(-)

diffs (83 lines):

diff -r 172942ae0b58 -r 10c163bb5e22 src/imap/main.c
--- 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
 
diff -r 172942ae0b58 -r 10c163bb5e22 src/lib-master/master-interface.h
--- 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,
diff -r 172942ae0b58 -r 10c163bb5e22 src/lmtp/main.c
--- 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;
diff -r 172942ae0b58 -r 10c163bb5e22 src/master/service-process.c
--- 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) {
diff -r 172942ae0b58 -r 10c163bb5e22 src/pop3/main.c
--- 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;
diff -r 172942ae0b58 -r 10c163bb5e22 src/util/script-login.c
--- 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,


More information about the dovecot-cvs mailing list