d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen/* We are attempting semi-compatibility with Postfix's master process here.
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen Whether this is useful or not remains to be seen. */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen/* Child processes should send status updates whenever they accept a new
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen connection (decrease available_count) and when they close existing
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen connection (increase available_count). */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen /* uid is used to check for old/invalid status messages */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen /* number of new connections process is currently accepting */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen/* When connecting to log service, send this handshake first */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen /* If magic is invalid, assume the data is already what we want
8e0ce05530ca549ce1dd402f43084a6fa15f05b4Timo Sirainen /* Add this prefix to each logged line */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen /* unsigned char prefix[]; */
d482079eb385cd071bbc9637cacee225e4aff968Timo Sirainen/* getenv(MASTER_IS_PARENT_ENV) != NULL if process was started by
d482079eb385cd071bbc9637cacee225e4aff968Timo Sirainen Dovecot master */
d482079eb385cd071bbc9637cacee225e4aff968Timo Sirainen#define MASTER_IS_PARENT_ENV "DOVECOT_CHILD_PROCESS"
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen/* getenv(MASTER_UID_ENV) provides master_status.uid value */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen/* getenv(MASTER_CLIENT_LIMIT_ENV) provides maximum
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen master_status.available_count as specified in configuration file */
1ffb2afe6d7e8860a2231a4827078cf2ef9c22cdTimo Sirainen/* getenv(MASTER_PROCESS_LIMIT_ENV) specifies how many processes of this type
1ffb2afe6d7e8860a2231a4827078cf2ef9c22cdTimo Sirainen can be created before reaching the limit */
1ffb2afe6d7e8860a2231a4827078cf2ef9c22cdTimo Sirainen#define MASTER_PROCESS_LIMIT_ENV "PROCESS_LIMIT"
d4845c4245638fd6f02dc0cb92c3465fae763cbbTimo Sirainen/* getenv(MASTER_PROCESS_MIN_AVAIL_ENV) specifies how many processes of this
d4845c4245638fd6f02dc0cb92c3465fae763cbbTimo Sirainen type are created at startup and are kept running all the time */
d4845c4245638fd6f02dc0cb92c3465fae763cbbTimo Sirainen#define MASTER_PROCESS_MIN_AVAIL_ENV "PROCESS_MIN_AVAIL"
788f275469ad9ed530e440d6690d0e4381a323b2Timo Sirainen/* getenv(MASTER_SERVICE_COUNT_ENV) specifies how many client connections the
788f275469ad9ed530e440d6690d0e4381a323b2Timo Sirainen process can finish handling before it should kill itself. */
788f275469ad9ed530e440d6690d0e4381a323b2Timo Sirainen#define MASTER_SERVICE_COUNT_ENV "SERVICE_COUNT"
0161376aac025266d8654577c4b9ce371ffc87eaTimo Sirainen/* getenv(MASTER_SERVICE_IDLE_KILL_ENV) specifies service's idle_kill timeout
0161376aac025266d8654577c4b9ce371ffc87eaTimo Sirainen in seconds. */
0161376aac025266d8654577c4b9ce371ffc87eaTimo Sirainen#define MASTER_SERVICE_IDLE_KILL_ENV "IDLE_KILL"
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen/* getenv(MASTER_CONFIG_FILE_ENV) provides path to configuration file/socket */
d482079eb385cd071bbc9637cacee225e4aff968Timo Sirainen/* getenv(MASTER_DOVECOT_VERSION_ENV) provides master's version number
d482079eb385cd071bbc9637cacee225e4aff968Timo Sirainen (unset if version_ignore=yes) */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen#define MASTER_DOVECOT_VERSION_ENV "DOVECOT_VERSION"
43d7e7ce608f5451e4907b5f5c48c00beb265802Timo Sirainen/* getenv(MASTER_SSL_KEY_PASSWORD_ENV) returns manually typed SSL key password,
43d7e7ce608f5451e4907b5f5c48c00beb265802Timo Sirainen if dovecot was started with -p parameter. */
43d7e7ce608f5451e4907b5f5c48c00beb265802Timo Sirainen#define MASTER_SSL_KEY_PASSWORD_ENV "SSL_KEY_PASSWORD"
d5eb47a791ec56149fd711cd8e44efc8babeaae5Timo Sirainen/* getenv(DOVECOT_PRESERVE_ENVS_ENV) returns a space separated list of
d5eb47a791ec56149fd711cd8e44efc8babeaae5Timo Sirainen environments that should be preserved. */
d5eb47a791ec56149fd711cd8e44efc8babeaae5Timo Sirainen#define DOVECOT_PRESERVE_ENVS_ENV "DOVECOT_PRESERVE_ENVS"
1fd856f1177990003ec3829267b9e490c095d836Timo Sirainen/* getenv(DOVECOT_LOG_DEBUG_ENV) returns the global log_debug setting. This can
1fd856f1177990003ec3829267b9e490c095d836Timo Sirainen be used to initialize debug logging immediately at startup. */
cf0ad1a0bddb0787f3d7b408a96d721a8b2a98a3Timo Sirainen/* Write pipe to anvil. */
230ef558135f16a66b86cbe3762524eaa9ae9d81Timo Sirainen/* Anvil reads new log fds from this fd */
cf0ad1a0bddb0787f3d7b408a96d721a8b2a98a3Timo Sirainen/* Master's "all processes full" notification fd for login processes */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen/* Shared pipe to master, used to send master_status reports */
cbcba924a745c938260fd39cb284175b75f8eaf2Timo Sirainen/* Pipe to master, used to detect when it dies. (MASTER_STATUS_FD would have
cbcba924a745c938260fd39cb284175b75f8eaf2Timo Sirainen been fine for this, except it's inefficient in Linux) */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen/* First file descriptor where process is expected to be listening.
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen The file descriptor count is given in -s parameter, defaulting to 1.
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen master_status.available_count reports how many accept()s we're still
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen accepting. Once no children are listening, master will do it and create
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen new child processes when needed. */
d99107ddf4d9bccb710994482daf65276a9d6321Timo Sirainen/* Timeouts: base everything on how long we can wait for login clients. */
d99107ddf4d9bccb710994482daf65276a9d6321Timo Sirainen/* auth server should abort auth requests before that happens */
d99107ddf4d9bccb710994482daf65276a9d6321Timo Sirainen#define MASTER_AUTH_SERVER_TIMEOUT_SECS (MASTER_LOGIN_TIMEOUT_SECS - 30)
d99107ddf4d9bccb710994482daf65276a9d6321Timo Sirainen/* auth clients should abort auth lookups after server was supposed to have