{
const char *path;
+ if ((service->flags & MASTER_SERVICE_FLAG_LOG_TO_STDERR) != 0) {
+ i_set_failure_file("/dev/stderr", "");
+ return;
+ }
+
if (getenv("LOG_TO_MASTER") != NULL && !service->log_directly) {
/* logging via master process */
i_set_failure_internal();
/* stdin/stdout already contains a client which we want to serve */
MASTER_SERVICE_FLAG_STD_CLIENT = 0x01,
/* this process is currently running standalone without a master */
- MASTER_SERVICE_FLAG_STANDALONE = 0x02
+ MASTER_SERVICE_FLAG_STANDALONE = 0x02,
+ /* Log to stderr instead of the configured log file */
+ MASTER_SERVICE_FLAG_LOG_TO_STDERR = 0x04
};
struct master_service;
const char *getopt_str, *user;
int c;
- service = master_service_init("doveadm", MASTER_SERVICE_FLAG_STANDALONE,
+ service = master_service_init("doveadm",
+ MASTER_SERVICE_FLAG_STANDALONE |
+ MASTER_SERVICE_FLAG_LOG_TO_STDERR,
argc, argv);
user = getenv("USER");