]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Set VERBOSE_PROCTITLE environment to child processes
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 23 Mar 2023 23:53:43 +0000 (01:53 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 27 Mar 2023 18:03:20 +0000 (18:03 +0000)
This is needed for updating process title during initialization before
settings are read.

src/lib-master/master-interface.h
src/master/service-process.c

index 0c3ab6909da7c3dc2ed05ddd1c232a6233f50111..f071bb2155ffcb0196051af25e546597ab343579 100644 (file)
@@ -66,6 +66,10 @@ enum master_login_state {
 /* getenv(MASTER_CONFIG_FILE_ENV) provides path to configuration file/socket */
 #define MASTER_CONFIG_FILE_ENV "CONFIG_FILE"
 
+/* getenv(MASTER_VERBOSE_PROCTITLE_ENV) is non-NULL if verbose_proctitle=yes.
+   This is used by lib-master during initialization. */
+#define MASTER_VERBOSE_PROCTITLE_ENV "VERBOSE_PROCTITLE"
+
 /* getenv(MASTER_DOVECOT_VERSION_ENV) provides master's version number
    (unset if version_ignore=yes) */
 #define MASTER_DOVECOT_VERSION_ENV "DOVECOT_VERSION"
index e08891a945a5f112feafa75e6a60a5357e69fbee..148b9e2f072db8a02ce2833b8a8e64398478e356 100644 (file)
@@ -316,6 +316,8 @@ service_process_setup_environment(struct service *service, unsigned int uid,
        env_put(MY_HOSTNAME_ENV, my_hostname);
        env_put(MY_HOSTDOMAIN_ENV, hostdomain);
 
+       if (service_set->verbose_proctitle)
+               env_put(MASTER_VERBOSE_PROCTITLE_ENV, "1");
        if (!service->set->master_set->version_ignore)
                env_put(MASTER_DOVECOT_VERSION_ENV, PACKAGE_VERSION);