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