diff src/master/login-process.c @ 925:2e649dec0f09 HEAD

Auth and login processes send an "we're ok" reply at the end of initialization. If the process dies before master receives that reply, it shutdowns itself. Usually this is because of some configuration error and it's not nice to start spamming the log files.
author Timo Sirainen <tss@iki.fi>
date Wed, 08 Jan 2003 23:13:05 +0200
parents fd8888f6f037
children a763b3826762
line wrap: on
line diff
--- a/src/master/login-process.c	Wed Jan 08 22:49:51 2003 +0200
+++ b/src/master/login-process.c	Wed Jan 08 23:13:05 2003 +0200
@@ -24,6 +24,7 @@
 	int fd;
 	struct io *io;
 	struct ostream *output;
+	unsigned int initialized:1;
 	unsigned int listening:1;
 	unsigned int destroyed:1;
 };
@@ -131,9 +132,14 @@
 	}
 
 	if (client_fd == -1) {
-		/* just a notification that the login process isn't
-		   listening for new connections anymore */
-		login_process_mark_nonlistening(p);
+		/* just a notification that the login process */
+		if (!p->initialized) {
+			/* initialization notify */
+			p->initialized = TRUE;;
+		} else {
+			/* not listening for new connections anymore */
+			login_process_mark_nonlistening(p);
+		}
 		return;
 	}
 
@@ -210,6 +216,8 @@
 		return;
 	p->destroyed = TRUE;
 
+	if (!p->initialized)
+		i_fatal("Login process died too early - shutting down");
 	if (p->listening)
 		listening_processes--;