diff -up nfs-utils-1.3.0/support/include/nsm.h.orig nfs-utils-1.3.0/support/include/nsm.h
--- nfs-utils-1.3.0/support/include/nsm.h.orig 2014-03-25 11:12:07.000000000 -0400
+++ nfs-utils-1.3.0/support/include/nsm.h 2016-06-23 10:09:34.216841414 -0400
@@ -59,7 +59,8 @@ extern unsigned int
extern _Bool nsm_insert_monitored_host(const char *hostname,
const struct sockaddr *sap, const struct mon *m);
extern void nsm_delete_monitored_host(const char *hostname,
- const char *mon_name, const char *my_name);
+ const char *mon_name, const char *my_name,
+ const int chatty);
extern void nsm_delete_notified_host(const char *hostname,
const char *mon_name, const char *my_name);
extern size_t nsm_priv_to_hex(const char *priv, char *buf,
diff -up nfs-utils-1.3.0/support/nsm/file.c.orig nfs-utils-1.3.0/support/nsm/file.c
--- nfs-utils-1.3.0/support/nsm/file.c.orig 2014-03-25 11:12:07.000000000 -0400
+++ nfs-utils-1.3.0/support/nsm/file.c 2016-06-23 10:09:34.216841414 -0400
@@ -1012,7 +1012,7 @@ nsm_load_notify_list(nsm_populate_t func
static void
nsm_delete_host(const char *directory, const char *hostname,
- const char *mon_name, const char *my_name)
+ const char *mon_name, const char *my_name, const int chatty)
{
char line[LINELEN + 1 + SM_MAXSTRLEN + 2];
char *outbuf = NULL;
@@ -1028,8 +1028,9 @@ nsm_delete_host(const char *directory, c
}
if (stat(path, &stb) == -1) {
- xlog(L_ERROR, "Failed to delete: "
- "could not stat original file %s: %m", path);
+ if (chatty)
+ xlog(L_ERROR, "Failed to delete: "
+ "could not stat original file %s: %m", path);
goto out;
}
remaining = (size_t)stb.st_size + 1;
@@ -1108,13 +1109,14 @@ out:
* @hostname: '\0'-terminated C string containing hostname of record to delete
* @mon_name: '\0'-terminated C string containing monname of record to delete
* @my_name: '\0'-terminated C string containing myname of record to delete
+ * @chatty: should an error be logged if the monitor file doesn't exist?
*
*/
void
nsm_delete_monitored_host(const char *hostname, const char *mon_name,
- const char *my_name)
+ const char *my_name, const int chatty)
{
- nsm_delete_host(NSM_MONITOR_DIR, hostname, mon_name, my_name);
+ nsm_delete_host(NSM_MONITOR_DIR, hostname, mon_name, my_name, chatty);
}
/**
@@ -1128,5 +1130,5 @@ void
nsm_delete_notified_host(const char *hostname, const char *mon_name,
const char *my_name)
{
- nsm_delete_host(NSM_NOTIFY_DIR, hostname, mon_name, my_name);
+ nsm_delete_host(NSM_NOTIFY_DIR, hostname, mon_name, my_name, 1);
}
diff -up nfs-utils-1.3.0/utils/statd/monitor.c.orig nfs-utils-1.3.0/utils/statd/monitor.c
--- nfs-utils-1.3.0/utils/statd/monitor.c.orig 2016-06-23 10:08:34.442835693 -0400
+++ nfs-utils-1.3.0/utils/statd/monitor.c 2016-06-23 10:09:34.216841414 -0400
@@ -193,7 +193,7 @@ sm_mon_1_svc(struct mon *argp, struct sv
* Now, Create file on stable storage for host, first deleting any
* existing records on file.
*/
- nsm_delete_monitored_host(dnsname, mon_name, my_name);
+ nsm_delete_monitored_host(dnsname, mon_name, my_name, 0);
if (!nsm_insert_monitored_host(dnsname,
(struct sockaddr *)(char *)&my_addr, argp)) {
@@ -324,7 +324,7 @@ sm_unmon_1_svc(struct mon_id *argp, stru
ha_callout("del-client", mon_name, my_name, -1);
nsm_delete_monitored_host(clnt->dns_name,
- mon_name, my_name);
+ mon_name, my_name, 1);
nlist_free(&rtnl, clnt);
return (&result);
@@ -379,7 +379,7 @@ sm_unmon_all_1_svc(struct my_id *argp, s
/* PRC: do the HA callout: */
ha_callout("del-client", mon_name, my_name, -1);
nsm_delete_monitored_host(clnt->dns_name,
- mon_name, my_name);
+ mon_name, my_name, 1);
nlist_free(&rtnl, clnt);
++count;
clnt = temp;