Module Name:    src
Committed By:   dholland
Date:           Tue Jun 10 17:19:48 UTC 2014

Modified Files:
        src/usr.sbin/ypbind: ypbind.c

Log Message:
Log state transitions.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/usr.sbin/ypbind/ypbind.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/ypbind/ypbind.c
diff -u src/usr.sbin/ypbind/ypbind.c:1.97 src/usr.sbin/ypbind/ypbind.c:1.98
--- src/usr.sbin/ypbind/ypbind.c:1.97	Tue Jun 10 17:19:36 2014
+++ src/usr.sbin/ypbind/ypbind.c	Tue Jun 10 17:19:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ypbind.c,v 1.97 2014/06/10 17:19:36 dholland Exp $	*/
+/*	$NetBSD: ypbind.c,v 1.98 2014/06/10 17:19:48 dholland Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993 Theo de Raadt <[email protected]>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef LINT
-__RCSID("$NetBSD: ypbind.c,v 1.97 2014/06/10 17:19:36 dholland Exp $");
+__RCSID("$NetBSD: ypbind.c,v 1.98 2014/06/10 17:19:48 dholland Exp $");
 #endif
 
 #include <sys/types.h>
@@ -628,6 +628,12 @@ rpc_received(char *dom_name, struct sock
 	dom->dom_losttime = 0;
 	dom->dom_backofftime = 10;
 
+	if (is_ypset == 0) {
+		yp_log(LOG_NOTICE, "Domain %s is alive; server %s",
+		       dom->dom_name,
+		       inet_ntoa(dom->dom_server_addr.sin_addr));
+	}
+
 	/*
 	 * Generate a new binding file. If this fails, forget about it.
 	 * (But we keep the binding and we'll report it to anyone who
@@ -1514,6 +1520,9 @@ checkwork(void)
 			dom->dom_state = DOM_LOST;
 			dom->dom_losttime = t;
 			dom->dom_checktime = t + 5;
+			yp_log(LOG_NOTICE, "Domain %s lost its binding to "
+			       "server %s", dom->dom_name,
+			       inet_ntoa(dom->dom_server_addr.sin_addr));
 			(void)nag_servers(dom);
 			break;
 
@@ -1521,6 +1530,9 @@ checkwork(void)
 			if (t > dom->dom_losttime + 60) {
 				dom->dom_state = DOM_DEAD;
 				dom->dom_backofftime = 10;
+				yp_log(LOG_NOTICE, "Domain %s dead; "
+				       "going to exponential backoff",
+				       dom->dom_name);
 			}
 			dom->dom_checktime = t + 5;
 			(void)nag_servers(dom);

Reply via email to