From c9eab79f70e80df51829193858304a797621ecdd Mon Sep 17 00:00:00 2001 From: Scott Mayhew Date: Tue, 4 Apr 2017 13:53:48 -0400 Subject: sm-notify: ending the grace period early should be configurable sm-notify's early ending of the grace period when it has no hosts to notify can cause problems in some high availability configurations, which may be running one sm-notify per floating IP address in the cluster. This commit makes that behavior configurable via the nfs.conf (I don't think having a corresponding command line option would be particularly useful, hence none was added). Acked-by: J. Bruce Fields Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson --- utils/statd/sm-notify.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'utils/statd/sm-notify.c') diff --git a/utils/statd/sm-notify.c b/utils/statd/sm-notify.c index 623213e..0c6766f 100644 --- a/utils/statd/sm-notify.c +++ b/utils/statd/sm-notify.c @@ -45,6 +45,8 @@ #define NLM_END_GRACE_FILE "/proc/fs/lockd/nlm_end_grace" +int lift_grace = 1; + struct nsm_host { struct nsm_host * next; char * name; @@ -494,6 +496,7 @@ main(int argc, char **argv) opt_max_retry = conf_get_num("sm-notify", "retry-time", opt_max_retry / 60) * 60; opt_srcport = conf_get_str("sm-notify", "outgoing-port"); opt_srcaddr = conf_get_str("sm-notify", "outgoing-addr"); + lift_grace = conf_get_bool("sm-notify", "lift-grace", lift_grace); s = conf_get_str("statd", "state-directory-path"); if (s && !nsm_setup_pathnames(argv[0], s)) exit(1); @@ -570,7 +573,8 @@ usage: fprintf(stderr, (void)nsm_retire_monitored_hosts(); if (nsm_load_notify_list(smn_get_host) == 0) { xlog(D_GENERAL, "No hosts to notify; exiting"); - nsm_lift_grace_period(); + if (lift_grace) + nsm_lift_grace_period(); return 0; } -- cgit