From 28588d3170a4185122ca2ce1d33ef350703db969 Mon Sep 17 00:00:00 2001 From: Alexander Scheel Date: Jun 26 2017 21:21:00 +0000 Subject: Conditionally reload kernel interface on SIGHUP Signed-off-by: Alexander Scheel [rharwood@redhat.com: Simplified logic, rewrote commit message] Reviewed-by: Robbie Harwood Resolves: #193 Merges: #201 --- diff --git a/proxy/src/gp_init.c b/proxy/src/gp_init.c index db56f1c..f64e22c 100644 --- a/proxy/src/gp_init.c +++ b/proxy/src/gp_init.c @@ -145,6 +145,7 @@ void init_proc_nfsd(struct gp_config *cfg) char buf[] = "1"; bool enabled = false; int fd, ret; + static int poked = 0; /* check first if any service enabled kernel support */ for (int i = 0; i < cfg->num_svcs; i++) { @@ -154,7 +155,7 @@ void init_proc_nfsd(struct gp_config *cfg) } } - if (!enabled) { + if (!enabled || poked) { return; } @@ -175,6 +176,7 @@ void init_proc_nfsd(struct gp_config *cfg) goto fail; } + poked = 1; close(fd); return; fail: diff --git a/proxy/src/gssproxy.c b/proxy/src/gssproxy.c index 9ffec5e..3cdc220 100644 --- a/proxy/src/gssproxy.c +++ b/proxy/src/gssproxy.c @@ -140,6 +140,9 @@ static void hup_handler(verto_ctx *vctx, verto_ev *ev UNUSED) exit(ret); } + /* conditionally reload kernel interface */ + init_proc_nfsd(gpctx->config); + free_config(&old_config); GPDEBUG("New config loaded successfully.\n");