bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2005-2018 Dovecot authors, see the included COPYING file */
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainensig_reopen_logs(const siginfo_t *si ATTR_UNUSED, void *context ATTR_UNUSED)
9a795eb60306eede5efc7e8ec5d584457a49e32eTimo Sirainen master_service_init_log(master_service, global_log_prefix);
5512d420d826a2f9d4e7cb4e4919e1864fe688b0Timo Sirainen lib_signals_set_handler(SIGUSR1, LIBSIG_FLAGS_SAFE,
db693bf6fcae96d834567f1782257517b7207655Timo Sirainenstatic void client_connected(struct master_service_connection *conn)
acba68a69cdd6f3f00faa18cccef356d95048e46Timo Sirainen log_connection_create(errorbuf, conn->fd, conn->listen_fd);
9da1a079c12108658d58876cd8d157418b3b518cTimo Sirainen /* kludge: normally FIFOs aren't counted as connections,
9da1a079c12108658d58876cd8d157418b3b518cTimo Sirainen but here we want log process to stay open until all writers
9da1a079c12108658d58876cd8d157418b3b518cTimo Sirainen have closed */
9da1a079c12108658d58876cd8d157418b3b518cTimo Sirainen } else if (strcmp(conn->name, "log-errors") == 0)
acba68a69cdd6f3f00faa18cccef356d95048e46Timo Sirainen doveadm_connection_create(errorbuf, conn->fd);
acba68a69cdd6f3f00faa18cccef356d95048e46Timo Sirainen i_error("Unknown listener name: %s", conn->name);
db693bf6fcae96d834567f1782257517b7207655Timo Sirainen master_service_client_connection_accept(conn);
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen master_service = master_service_init("log", 0, &argc, &argv, "");
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen /* use log prefix and log to stderr until we've configured the real
2fb27941fb13f48e728365c1332039bfa63aca6eTimo Sirainen global_log_prefix = i_strdup_printf("log(%s): ", my_pid);
9a795eb60306eede5efc7e8ec5d584457a49e32eTimo Sirainen i_set_failure_file("/dev/stderr", global_log_prefix);
4d4d6d4745682790c20d759ba93dbea46b812c5dTimo Sirainen if (master_service_settings_read_simple(master_service,
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen i_fatal("Error reading configuration: %s", error);
9a795eb60306eede5efc7e8ec5d584457a49e32eTimo Sirainen master_service_init_log(master_service, global_log_prefix);
f2880c3c3de56ec757ffc393363bb863efd7bcbeTimo Sirainen verbose_proctitle = master_service_settings_get(master_service)->verbose_proctitle;
816d20be0cf95fc4eb1a8aa716639e73b8ba525eMartti Rannanjärvi restrict_access_by_env(RESTRICT_ACCESS_FLAG_ALLOW_ROOT, NULL);
86791365b10f45982c88e70f2eb94fd6c3fea151Timo Sirainen /* logging should never die if there are some clients */
86791365b10f45982c88e70f2eb94fd6c3fea151Timo Sirainen master_service_set_die_with_master(master_service, FALSE);