changeset 5136:86625faa49b5 HEAD

Start auth processes immediately at startup, not after one second delay. Don't try to start any login processes before at least one auth process has sent back a handshake.
author Timo Sirainen <tss@iki.fi>
date Thu, 15 Feb 2007 15:08:37 +0200
parents 1a7359d6a774
children 89aec9ce88bc
files src/master/auth-process.c src/master/auth-process.h src/master/login-process.c
diffstat 3 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/master/auth-process.c	Thu Feb 15 14:12:55 2007 +0200
+++ b/src/master/auth-process.c	Thu Feb 15 15:08:37 2007 +0200
@@ -54,6 +54,8 @@
 	unsigned int in_auth_reply:1;
 };
 
+bool have_initialized_auth_processes = FALSE;
+
 static struct timeout *to;
 static unsigned int auth_tag;
 static struct auth_process_group *process_groups;
@@ -167,6 +169,8 @@
 
 	process->pid = pid;
         process->initialized = TRUE;
+
+	have_initialized_auth_processes = TRUE;
 	return TRUE;
 }
 
@@ -772,6 +776,8 @@
 {
 	process_groups = NULL;
 	to = timeout_add(1000, auth_processes_start_missing, NULL);
+
+	auth_processes_start_missing(NULL);
 }
 
 void auth_processes_deinit(void)
--- a/src/master/auth-process.h	Thu Feb 15 14:12:55 2007 +0200
+++ b/src/master/auth-process.h	Thu Feb 15 15:08:37 2007 +0200
@@ -3,6 +3,8 @@
 
 struct login_auth_request;
 
+extern bool have_initialized_auth_processes;
+
 void auth_master_callback(const char *user, const char *const *args,
 			  struct login_auth_request *request);
 
--- a/src/master/login-process.c	Thu Feb 15 14:12:55 2007 +0200
+++ b/src/master/login-process.c	Thu Feb 15 15:08:37 2007 +0200
@@ -793,6 +793,12 @@
 {
 	struct login_group *group;
 
+	if (!have_initialized_auth_processes) {
+		/* don't create login processes before at least one auth
+		   process has finished initializing */
+		return;
+	}
+
 	if (login_groups == NULL)
 		login_process_groups_create();