summaryrefslogtreecommitdiffstats
path: root/source/nmbd/asyncdns.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-12-04 10:58:40 +0000
committerAndrew Tridgell <tridge@samba.org>1997-12-04 10:58:40 +0000
commitfa599067f074647a5bad2ffd0fce12ae0a4e43d2 (patch)
treeb94a24d3f38e308f047f8fcb7bf7d4285712088c /source/nmbd/asyncdns.c
parent8bac91a6e7a3601b093cb64e9cb3bcc1663fb4d4 (diff)
downloadsamba-fa599067f074647a5bad2ffd0fce12ae0a4e43d2.tar.gz
samba-fa599067f074647a5bad2ffd0fce12ae0a4e43d2.tar.xz
samba-fa599067f074647a5bad2ffd0fce12ae0a4e43d2.zip
catch signals in the async dns daemon and allow it to auto-restart if
necessary
Diffstat (limited to 'source/nmbd/asyncdns.c')
-rw-r--r--source/nmbd/asyncdns.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/nmbd/asyncdns.c b/source/nmbd/asyncdns.c
index f15880080f5..57d0eda9b36 100644
--- a/source/nmbd/asyncdns.c
+++ b/source/nmbd/asyncdns.c
@@ -128,6 +128,10 @@ void start_async_dns(void)
fd_in = fd2[0];
fd_out = fd1[1];
+ signal(SIGUSR2, SIG_IGN);
+ signal(SIGUSR1, SIG_IGN);
+ signal(SIGHUP, SIG_IGN);
+
asyncdns_process();
}
@@ -167,6 +171,11 @@ void run_dns_queue(void)
if (fd_in == -1)
return;
+ if (!process_exists(child_pid)) {
+ close(fd_in);
+ start_async_dns();
+ }
+
if ((size=read_data(fd_in, (char *)&r, sizeof(r))) != sizeof(r)) {
if (size) {
DEBUG(0,("Incomplete DNS answer from child!\n"));