Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Feb 2019 08:15:26 +0000 (UTC)
From:      Doug Rabson <dfr@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343706 - head/usr.sbin/rpc.statd
Message-ID:  <201902030815.x138FQiw005736@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dfr
Date: Sun Feb  3 08:15:26 2019
New Revision: 343706
URL: https://svnweb.freebsd.org/changeset/base/343706

Log:
  Reduce log spam from rpc.statd
  
  This only reports failed attempts to contact hosts on the first attempt.

Modified:
  head/usr.sbin/rpc.statd/file.c

Modified: head/usr.sbin/rpc.statd/file.c
==============================================================================
--- head/usr.sbin/rpc.statd/file.c	Sun Feb  3 05:26:10 2019	(r343705)
+++ head/usr.sbin/rpc.statd/file.c	Sun Feb  3 08:15:26 2019	(r343706)
@@ -248,9 +248,12 @@ void init_file(const char *filename)
 /*
    Purpose:	Perform SM_NOTIFY procedure at specified host
    Returns:	TRUE if success, FALSE if failed.
+   Notes:	Only report failure if verbose is non-zero. Caller will
+		only set verbose to non-zero for the first attempt to
+		contact the host.
 */
 
-static int notify_one_host(char *hostname)
+static int notify_one_host(char *hostname, int verbose)
 {
   struct timeval timeout = { 20, 0 };	/* 20 secs timeout		*/
   CLIENT *cli;
@@ -277,7 +280,8 @@ static int notify_one_host(char *hostname)
       (xdrproc_t)xdr_void, &dummy, timeout)
     != RPC_SUCCESS)
   {
-    syslog(LOG_ERR, "Failed to contact rpc.statd at host %s", hostname);
+    if (verbose)
+      syslog(LOG_ERR, "Failed to contact rpc.statd at host %s", hostname);
     clnt_destroy(cli);
     return (FALSE);
   }
@@ -346,7 +350,7 @@ void notify_hosts(void)
     {
       if (hp->notifyReqd)
       {
-        if (notify_one_host(hp->hostname))
+        if (notify_one_host(hp->hostname, attempts == 0))
 	{
 	  hp->notifyReqd = FALSE;
           sync_file();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902030815.x138FQiw005736>