]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
"Running standalone?" check now uses a new DOVECOT_CHILD_PROCESS environment rather...
authorTimo Sirainen <tss@iki.fi>
Mon, 15 Nov 2010 17:03:52 +0000 (17:03 +0000)
committerTimo Sirainen <tss@iki.fi>
Mon, 15 Nov 2010 17:03:52 +0000 (17:03 +0000)
The GENERATION environment was already set in some systems for Java.

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

index 7a9d757021cc3724176db9060cce37ec12ee4abd..1291add1e8d9f2d6caeab5873674b3733c57a192 100644 (file)
@@ -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
 
index f595bd2e12262021f882c2e15456eb1b97ebef61..005abc5e871551b205d20382cac896a0255edba2 100644 (file)
@@ -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,
index ead45bd3ed2ed51358b015a0e8bc55829d0abb79..17957f34566b416acf65420aba2bf68c5b53f675 100644 (file)
@@ -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;
index fc589a8d94ef04a1d472766a4169dc287367ab65..203179a52d9e015bf776ecdf88acbbabec425f93 100644 (file)
@@ -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) {
index afb49a6c3c58a946811b7d1eba330114f71a8752..846b4a863775b6ee58e87d414f90a7919191d7c4 100644 (file)
@@ -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;
index d93544580af999b05e57256da894032bc19b9681..e1ca3a62edec437f841cf07a6ea86740f73762f1 100644 (file)
@@ -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,