master-service.c revision c668292359474a4aa8c608b30a858337fa3fc813
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen/* Copyright (C) 2005-2009 Timo Sirainen */
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen#define DEFAULT_CONFIG_FILE_PATH SYSCONFDIR"/dovecot.conf"
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen/* getenv(MASTER_CONFIG_FILE_ENV) provides path to configuration file/socket */
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen/* getenv(MASTER_DOVECOT_VERSION_ENV) provides master's version number */
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen#define MASTER_DOVECOT_VERSION_ENV "DOVECOT_VERSION"
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenstatic void io_listeners_add(struct master_service *service);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenstatic void io_listeners_remove(struct master_service *service);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenstatic void master_status_update(struct master_service *service);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen return "c:ko:Os:L";
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenstatic void sig_die(const siginfo_t *si, void *context)
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen /* warn about being killed because of some signal, except SIGINT (^C)
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen which is too common at least while testing :) */
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen i_warning("Killed with signal %d (by pid=%s uid=%s code=%s)",
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen lib_signal_code_to_str(si->si_signo, si->si_code));
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenstatic void master_service_verify_version(struct master_service *service)
struct master_service *
const char *str;
#ifdef DEBUG
int count;
lib_init();
return service;
unsigned int max_lines_per_sec)
const char *path;
int facility;
&facility))
switch (opt) {
return FALSE;
return TRUE;
const char *value;
unsigned int count;
if (count == 0)
#ifdef DEBUG
env_clean();
#ifdef DEBUG
unsigned int client_limit)
unsigned int count)
unsigned int used;
if (ret < 0)
else if (ret == 0)
lib_deinit();
return TRUE;
return TRUE;
return FALSE;
if (ret > 0) {
} else if (ret == 0) {