[dovecot] Re: Unable to Log in on FreeBSD server?

Timo Sirainen tss at iki.fi
Tue Jan 21 10:00:56 EET 2003


On Sun, 2003-01-19 at 05:36, Mark wrote:
> I recently recompiled with --enable-asserts and --enable-debug, and I
> when trying to log in to either port 143 or port 993 using Outlook
> Express, the following happens:

--enable-asserts is actually the default. --enable-debug does only some
internal sanity checks and bad performance warnings.

> 1. Outlook Express complains that the authentication failed with "Login
> Process died unexpectedly"
> 2. The imap-master and all other processes die on my FreeBSD machine.
> 3. I see the following in the logs:
> 
> Jan 18 19:32:21 akira imap-master: Login process died too early -
> shutting down

That "close(master) failed: Bad file descriptor" you had in log is the
only indicator that something wrong even happened. But it still should
have logged something more.

Hmm. Looks like the new code that complains about auth/login process
dying too soon doesn't tell the reason for it if the process crashed or
exited without logging a failure.

See if the attached patch shows something more in the logs? It doesn't
fix the problem, but at least I'll know if it crashes or something else.

-------------- next part --------------
? src/master/gmon.out
Index: src/master/auth-process.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/auth-process.c,v
retrieving revision 1.26
diff -u -r1.26 auth-process.c
--- src/master/auth-process.c	21 Jan 2003 07:40:54 -0000	1.26
+++ src/master/auth-process.c	21 Jan 2003 07:57:29 -0000
@@ -160,8 +160,10 @@
 	struct auth_process **pos;
 	struct waiting_request *next;
 
-	if (!p->initialized)
-		i_fatal("Auth process died too early - shutting down");
+	if (!p->initialized) {
+		i_error("Auth process died too early - shutting down");
+		io_loop_stop(ioloop);
+	}
 
 	for (pos = &processes; *pos != NULL; pos = &(*pos)->next) {
 		if (*pos == p) {
Index: src/master/common.h
===================================================================
RCS file: /home/cvs/dovecot/src/master/common.h,v
retrieving revision 1.9
diff -u -r1.9 common.h
--- src/master/common.h	5 Jan 2003 13:09:53 -0000	1.9
+++ src/master/common.h	21 Jan 2003 07:57:29 -0000
@@ -18,6 +18,7 @@
 	PROCESS_TYPE_MAX
 };
 
+extern struct ioloop *ioloop;
 extern struct hash_table *pids;
 extern int null_fd, imap_fd, imaps_fd;
 
Index: src/master/login-process.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/login-process.c,v
retrieving revision 1.28
diff -u -r1.28 login-process.c
--- src/master/login-process.c	11 Jan 2003 15:29:47 -0000	1.28
+++ src/master/login-process.c	21 Jan 2003 07:57:29 -0000
@@ -223,8 +223,10 @@
 		return;
 	p->destroyed = TRUE;
 
-	if (!p->initialized)
-		i_fatal("Login process died too early - shutting down");
+	if (!p->initialized) {
+		i_error("Login process died too early - shutting down");
+		io_loop_stop(ioloop);
+	}
 	if (p->listening)
 		listening_processes--;
 
Index: src/master/main.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/main.c,v
retrieving revision 1.27
diff -u -r1.27 main.c
--- src/master/main.c	11 Jan 2003 15:29:47 -0000	1.27
+++ src/master/main.c	21 Jan 2003 07:57:29 -0000
@@ -28,9 +28,9 @@
 };
 
 static const char *configfile = SYSCONFDIR "/" PACKAGE ".conf";
-static struct ioloop *ioloop;
 static struct timeout *to;
 
+struct ioloop *ioloop;
 struct hash_table *pids;
 int null_fd, imap_fd, imaps_fd;
 
@@ -258,6 +258,9 @@
 {
         if (lib_signal_kill != 0)
 		i_warning("Killed with signal %d", lib_signal_kill);
+
+	/* make sure we log if child processes died unexpectedly */
+	timeout_handler(NULL, NULL);
 
 	login_processes_deinit();
 	auth_processes_deinit();


More information about the dovecot mailing list