diff --git a/uwsgi.c b/uwsgi.c index d7221ce9..044cf52b 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -3691,12 +3691,18 @@ static int manage_base_opt(int i, char *optarg) { #endif case 'd': - if (!uwsgi.is_a_reload) { - daemonize(optarg); - } - else if (uwsgi.log_reopen) { + // do not daemonize in emperor mode + if (uwsgi.has_emperor) { logto(optarg); } + else { + if (!uwsgi.is_a_reload) { + daemonize(optarg); + } + else if (uwsgi.log_reopen) { + logto(optarg); + } + } return 1; case 's': uwsgi_sock = uwsgi_new_socket(generate_socket_name(optarg));