]> 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>
Sun, 14 May 2023 17:52:36 +0000 (17:52 +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 e5db7ce720c42e8d9f7ac92564e4143d64ab59cd..befeab057b1db1bf1c10d8571058f17dd8613114 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 3d830d591101dffb43eab3023b97a345ff34b7be..24e68bf83ea714c56cece8f9d4ff47b2087b63e9 100644 (file)
@@ -260,6 +260,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);