We enabled dns caching with a configuration like dns_cache_hosts(/etc/hosts), and found that syslog-ng was re-reading the hosts file every time it needed to resolve a host name. This patch fixed it. diff -ru syslog-ng-2.0.6/src/dnscache.c syslog-ng-2.0.6-patch/src/dnscache.c --- syslog-ng-2.0.6/src/dnscache.c 2007-04-19 15:37:16.000000000 -0400 +++ syslog-ng-2.0.6-patch/src/dnscache.c 2008-01-26 19:45:31.000000000 -0500 @@ -168,7 +168,9 @@ if (hosts) { gchar buf[4096]; - + + dns_cache_hosts_mtime = st.st_mtime; + while (fgets(buf, sizeof(buf), hosts)) { gchar *p, *ip;
On Tue, 2008-01-29 at 13:59 -0500, Steven McDougall wrote:
We enabled dns caching with a configuration like dns_cache_hosts(/etc/hosts), and found that syslog-ng was re-reading the hosts file every time it needed to resolve a host name. This patch fixed it.
Oops, this is embarassing. I've commited the fix, thank you.
diff -ru syslog-ng-2.0.6/src/dnscache.c syslog-ng-2.0.6-patch/src/dnscache.c --- syslog-ng-2.0.6/src/dnscache.c 2007-04-19 15:37:16.000000000 -0400 +++ syslog-ng-2.0.6-patch/src/dnscache.c 2008-01-26 19:45:31.000000000 -0500 @@ -168,7 +168,9 @@ if (hosts) { gchar buf[4096]; - + + dns_cache_hosts_mtime = st.st_mtime; + while (fgets(buf, sizeof(buf), hosts)) { gchar *p, *ip;
-- Bazsi
participants (2)
-
Balazs Scheidler
-
Steven McDougall