/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "array.h"
#include "env-util.h"
#include "fdpass.h"
#include "ioloop.h"
#include "restrict-access.h"
#include "master-service.h"
#include "master-service-settings.h"
#include "master-interface.h"
#include "connect-limit.h"
#include "penalty.h"
#include "anvil-connection.h"
#include <unistd.h>
bool anvil_restarted;
{
}
static void ATTR_NULL(1)
{
int fd;
char c;
/* master wants us to replace the log fd */
if (ret < 0)
i_error("fd_read(log fd) failed: %m");
else if (ret == 0) {
/* master died. lib-master should notice it soon. */
} else {
i_fatal("dup2(fd_read log fd, stderr) failed: %m");
i_error("close(fd_read log fd) failed: %m");
}
}
{
const char *error;
if (master_getopt(master_service) > 0)
return FATAL_DEFAULT;
/* delay dying until all of our clients are gone */
penalty = penalty_init();
return 0;
}