*/
#define MASTER_SERVICE_SOCKET_COUNT_ENV "SOCKET_COUNT"
+/* getenv(MASTER_SERVICE_LOG_SERVICE_ENV) will be set to '1' when
+ stderr is redirected to the log service.
+*/
+#define MASTER_SERVICE_LOG_SERVICE_ENV "LOG_SERVICE"
+
/* getenv(DOVECOT_PRESERVE_ENVS_ENV) returns a space separated list of
environments that should be preserved. */
#define DOVECOT_PRESERVE_ENVS_ENV "DOVECOT_PRESERVE_ENVS"
/* set up some kind of logging until we know exactly how and where
we want to log */
- if (getenv("LOG_SERVICE") != NULL)
+ if (getenv(MASTER_SERVICE_LOG_SERVICE_ENV) != NULL)
i_set_failure_internal();
if (getenv("USER") != NULL) {
i_set_failure_prefix("%s(%s): ", service->configured_name,
return TRUE;
}
- if (getenv("LOG_SERVICE") != NULL && !service->log_directly) {
+ if (getenv(MASTER_SERVICE_LOG_SERVICE_ENV) != NULL && !service->log_directly) {
/* logging via log service */
i_set_failure_internal();
i_set_failure_prefix("%s", prefix);
to be lost. */
i_assert(service->log_fd[1] != -1);
- env_put("LOG_SERVICE", "1");
+ env_put(MASTER_SERVICE_LOG_SERVICE_ENV, "1");
if (dup2(service->log_fd[1], STDERR_FILENO) < 0)
i_fatal("dup2(log fd) failed: %m");
i_set_failure_internal();