From 43c48320451c04db9c8550dc440ed443a9dcc120 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 21 Jan 2006 10:38:44 +0000 Subject: some minor changes to get mod_dnssd to work across graceful restarts git-svn-id: file:///home/lennart/svn/public/mod_dnssd/trunk@22 634eccf8-0006-0410-930e-e16565b0b7de --- src/mod_dnssd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mod_dnssd.c b/src/mod_dnssd.c index 0a9a2fa..da49db3 100644 --- a/src/mod_dnssd.c +++ b/src/mod_dnssd.c @@ -531,6 +531,8 @@ static void child_process(apr_pool_t *p, server_rec *server, struct global_confi ap_assert(d); + sleep(5); + unixd_setup_child(); if (pipe(sigterm_pipe_fds) < 0) { @@ -542,6 +544,8 @@ static void child_process(apr_pool_t *p, server_rec *server, struct global_confi set_nonblock(sigterm_pipe_fds[1]); apr_signal(SIGTERM, sigterm); + apr_signal(SIGHUP, sigterm); + apr_signal(AP_SIG_GRACEFUL, SIG_IGN); r.main_server = server; r.global_config_data = d; @@ -550,7 +554,7 @@ static void child_process(apr_pool_t *p, server_rec *server, struct global_confi r.services = NULL; apr_pool_create(&r.pool, p); -/* ap_log_error(APLOG_MARK, APLOG_ERR, 0, r.main_server, "Child process startup pid=%lu", (unsigned long) getpid()); */ + ap_log_error(APLOG_MARK, APLOG_ERR, 0, r.main_server, "Child process startup pid=%lu", (unsigned long) getpid()); assemble_services(&r); @@ -573,7 +577,7 @@ static void child_process(apr_pool_t *p, server_rec *server, struct global_confi goto quit; } -/* ap_log_error(APLOG_MARK, APLOG_ERR, 0, r.main_server, "Child process running"); */ + ap_log_error(APLOG_MARK, APLOG_ERR, 0, r.main_server, "Child process running"); avahi_simple_poll_loop(r.simple_poll); @@ -596,7 +600,7 @@ quit: sigterm_pipe_fds[0] = sigterm_pipe_fds[1] = -1; -/* ap_log_error(APLOG_MARK, APLOG_ERR, 0, r.main_server, "Child process ending"); */ + ap_log_error(APLOG_MARK, APLOG_ERR, 0, r.main_server, "Child process ending"); } static int start_child_process(apr_pool_t *p, server_rec *server, struct global_config_data *d) { -- cgit