summaryrefslogtreecommitdiffstats
path: root/proxy/src/gssproxy.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-01-03 12:10:36 -0500
committerSimo Sorce <simo@redhat.com>2014-01-04 10:26:53 -0500
commit393570b45816b690cb16fd1286d0705142ef2d62 (patch)
treef2d5bcd95c4ddc062f6ff30e28e8b59a9d51701a /proxy/src/gssproxy.c
parent8f9db4fcd44df680029ed5a493cda7cdcd9c91ee (diff)
downloadgss-proxy-usermode.tar.gz
gss-proxy-usermode.tar.xz
gss-proxy-usermode.zip
Block parent process until child is initialized.usermode
This way the init system will not proceed starting dependencies until gssproxy is actually ready to serve requests. In particular this is used to make sure the nfsd proc file has been touched before the nfsd server is started. Resolves: https://fedorahosted.org/gss-proxy/ticket/114 Signed-off-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'proxy/src/gssproxy.c')
-rw-r--r--proxy/src/gssproxy.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/proxy/src/gssproxy.c b/proxy/src/gssproxy.c
index 1bf0a0b..80430d6 100644
--- a/proxy/src/gssproxy.c
+++ b/proxy/src/gssproxy.c
@@ -42,6 +42,7 @@ int main(int argc, const char *argv[])
int vflags;
struct gssproxy_ctx *gpctx;
struct gp_sock_ctx *sock_ctx;
+ int wait_fd;
int ret;
int i;
@@ -97,7 +98,7 @@ int main(int argc, const char *argv[])
exit(EXIT_FAILURE);
}
- init_server(gpctx->config->daemonize);
+ init_server(gpctx->config->daemonize, &wait_fd);
write_pid();
@@ -139,9 +140,15 @@ int main(int argc, const char *argv[])
}
}
- /* special call to tell the Linux kernel gss-proxy is available */
+ /* We need to tell nfsd that GSS-Proxy is available before it starts,
+ * as nfsd needs to know GSS-Proxy is in use before the first time it
+ * needs to call accept_sec_context. */
init_proc_nfsd(gpctx->config);
+ /* Now it is safe to tell the init system that we're done starting up,
+ * so it can continue with dependencies and start nfsd */
+ init_done(wait_fd);
+
ret = drop_privs(gpctx->config);
if (ret) {
exit(EXIT_FAILURE);