The GENERATION environment was already set in some systems for Java.
#include <unistd.h>
#define IS_STANDALONE() \
- (getenv(MASTER_UID_ENV) == NULL)
+ (getenv(MASTER_IS_PARENT_ENV) == NULL)
#define IMAP_DIE_IDLE_SECS 10
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"
/* 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,
#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;
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) {
#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;
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,