summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_dual.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-09-15 14:05:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:51:49 -0500
commit07e9f4e61ae909d7ccc7ec7b650438510468829d (patch)
treec1c293453d9893f93dafc61a84db64084b1f36b6 /source3/nsswitch/winbindd_dual.c
parent315ad641c381b0630976eff711f251d1831ffc7c (diff)
downloadsamba-07e9f4e61ae909d7ccc7ec7b650438510468829d.tar.gz
samba-07e9f4e61ae909d7ccc7ec7b650438510468829d.tar.bz2
samba-07e9f4e61ae909d7ccc7ec7b650438510468829d.zip
r18551: Implement a 30 seconds from startup, during which we
try hard to connect a DC even if we might be offline. Jeremy. (This used to be commit a9f115140700487767bafa058db744eea5ee8f77)
Diffstat (limited to 'source3/nsswitch/winbindd_dual.c')
-rw-r--r--source3/nsswitch/winbindd_dual.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/nsswitch/winbindd_dual.c b/source3/nsswitch/winbindd_dual.c
index 659242e918..e2e0db8570 100644
--- a/source3/nsswitch/winbindd_dual.c
+++ b/source3/nsswitch/winbindd_dual.c
@@ -582,7 +582,7 @@ static void child_msg_offline(int msg_type, struct process_id src, void *buf, si
/* Ensure any negative cache entries with the netbios or realm names are removed. */
-static void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain)
+void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain)
{
flush_negative_conn_cache_for_domain(domain->name);
if (*domain->alt_name) {
@@ -681,6 +681,7 @@ static BOOL fork_domain_child(struct winbindd_child *child)
int fdpair[2];
struct winbindd_cli_state state;
extern BOOL override_logfile;
+ time_t startup_time;
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fdpair) != 0) {
DEBUG(0, ("Could not open child pipe: %s\n",
@@ -764,6 +765,9 @@ static BOOL fork_domain_child(struct winbindd_child *child)
message_register(MSG_WINBIND_ONLINE,child_msg_online);
message_register(MSG_WINBIND_ONLINESTATUS,child_msg_onlinestatus);
+ child->domain->startup = True;
+ startup_time = time(NULL);
+
while (1) {
int ret;
@@ -780,6 +784,13 @@ static BOOL fork_domain_child(struct winbindd_child *child)
GetTimeOfDay(&now);
+ if (child->domain->startup && (now.tv_sec > startup_time + 30)) {
+ /* No longer in "startup" mode. */
+ DEBUG(10,("fork_domain_child: domain %s no longer in 'startup' mode.\n",
+ child->domain->name ));
+ child->domain->startup = False;
+ }
+
tp = get_timed_events_timeout(&t);
if (tp) {
DEBUG(11,("select will use timeout of %u.%u seconds\n",