exit(FATAL_DEFAULT);
}
+ master_service_set_die_with_master(master_service, TRUE);
master_service_init_log(master_service, "anvil: ", 0);
master_service_init_finish(master_service);
connect_limit = connect_limit_init();
return;
ret = write(MASTER_ANVIL_FD, cmd, strlen(cmd));
- if (ret < 0)
+ if (ret < 0) {
+ if (errno == EPIPE) {
+ /* anvil process was probably recreated, don't bother
+ logging an error about losing connection to it */
+ return;
+ }
i_error("write(anvil) failed: %m");
- else if (ret == 0)
+ } else if (ret == 0)
i_error("write(anvil) failed: EOF");
else {
i_assert((size_t)ret == strlen(cmd));
ident = t_strconcat("LOOKUP\t", net_ip2addr(&client->ip), "/",
str_tabescape(client->virtual_user), "/",
login_protocol, "\n", NULL);
- if (write_full(anvil_fd, ident, strlen(ident)) < 0)
+ if (write_full(anvil_fd, ident, strlen(ident)) < 0) {
+ if (errno == EPIPE) {
+ /* anvil process was probably recreated, don't bother
+ logging an error about losing connection to it */
+ return FALSE;
+ }
i_fatal("write(anvil) failed: %m");
+ }
ret = read(anvil_fd, buf, sizeof(buf)-1);
if (ret < 0)
i_fatal("read(anvil) failed: %m");