The original check there never worked, because null_fd was always set.
Normally the master.pid file would prevent this happening, but if it didn't
exist, the sockets would be unlinked and usually also created back.
extern const char *ssl_manual_key_password;
extern int null_fd, global_master_dead_pipe_fd[2];
extern struct service_list *services;
+extern bool startup_finished;
void process_exec(const char *cmd, const char *extra_args[])
ATTR_NORETURN ATTR_NULL(2);
const char *ssl_manual_key_password;
int null_fd, global_master_dead_pipe_fd[2];
struct service_list *services;
+bool startup_finished = FALSE;
static char *pidfile_path;
static struct master_instance_list *instances;
master_clients_init();
services_monitor_start(services);
+ startup_finished = TRUE;
}
static void global_dead_pipe_close(void)
listening in them. do this only at startup, because
when SIGHUPing a child process might catch the new
connection before it notices that it's supposed
- to die. null_fd == -1 check is a bit kludgy, but works.. */
- if (null_fd == -1) {
+ to die. */
+ if (!startup_finished) {
int fd = net_connect_unix(str_c(str));
if (fd != -1 || errno != ECONNREFUSED) {
i_fatal("Dovecot is already running? "