]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Add SERVICE_NAME=<name> environment to child service processes
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 14 Apr 2020 16:26:46 +0000 (19:26 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 24 Apr 2020 10:42:00 +0000 (10:42 +0000)
src/lib-master/master-interface.h
src/master/service-process.c

index 1ddef5f6876907a47fde2fca6ce0022fca473760..e5db7ce720c42e8d9f7ac92564e4143d64ab59cd 100644 (file)
@@ -40,6 +40,9 @@ enum master_login_state {
 /* getenv(MASTER_UID_ENV) provides master_status.uid value */
 #define MASTER_UID_ENV "GENERATION"
 
+/* getenv(MASTER_SERVICE_NAME) provides the service's name */
+#define MASTER_SERVICE_ENV "SERVICE_NAME"
+
 /* getenv(MASTER_CLIENT_LIMIT_ENV) provides maximum
    master_status.available_count as specified in configuration file */
 #define MASTER_CLIENT_LIMIT_ENV "CLIENT_LIMIT"
index 36544498d8544413e9adfb68a04c4ac0e078823b..b5c8f14f6e7c3f4e48b1d3d83930eabf1521f58f 100644 (file)
@@ -244,6 +244,8 @@ service_process_setup_environment(struct service *service, unsigned int uid,
 
        env_put(MASTER_IS_PARENT_ENV"=1");
        service_process_setup_config_environment(service);
+       env_put(t_strdup_printf(MASTER_SERVICE_ENV"=%s",
+                               service->set->name));
        env_put(t_strdup_printf(MASTER_CLIENT_LIMIT_ENV"=%u",
                                service->client_limit));
        env_put(t_strdup_printf(MASTER_PROCESS_LIMIT_ENV"=%u",