diff options
author | Andris Mednis <Andris.Mednis@zabbix.com> | 2017-09-28 14:36:47 +0300 |
---|---|---|
committer | Andris Mednis <Andris.Mednis@zabbix.com> | 2017-09-28 14:36:47 +0300 |
commit | 37f44ba87b5e19c2d625e02647bea172ac7c8fe4 (patch) | |
tree | d71f5406be77e6ff2265123b4c6156110d1c41ab /src/zabbix_agent/listener.c | |
parent | dc99c9da0beaf1580d4175d2924ca819daac85a4 (diff) |
...G...PS. [ZBXNEXT-1862] modified server, proxy and agent to follow changes in /etc/resolv.conf
Before this change:
- server, proxy and agent read /etc/resolv.conf file only on startup. Later, when /etc/resolv.conf was updated
(e.g. DNS servers changed) the old content of /etc/resolv.conf was in effect, Zabbix had to be restarted
to pick up changes. One exception is Debian GNU/Linux, which reacts to /etc/resolv.conf update without
Zabbix modification.
After this change:
- server, proxy and agent check modification time of /etc/resolv.conf regularly in main loop and reinitialize
resolver when the modification time changes.
Diffstat (limited to 'src/zabbix_agent/listener.c')
-rw-r--r-- | src/zabbix_agent/listener.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/zabbix_agent/listener.c b/src/zabbix_agent/listener.c index fe51c7a3836..cbb8ec22915 100644 --- a/src/zabbix_agent/listener.c +++ b/src/zabbix_agent/listener.c @@ -151,7 +151,7 @@ ZBX_THREAD_ENTRY(listener_thread, args) } if (SUCCEED == ret || EINTR == zbx_socket_last_error()) - continue; + goto next; #if defined(HAVE_POLARSSL) || defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL) if (NULL != msg) @@ -168,6 +168,12 @@ ZBX_THREAD_ENTRY(listener_thread, args) if (ZBX_IS_RUNNING()) zbx_sleep(1); +next: +#if !defined(_WINDOWS) && defined(HAVE_RESOLV_H) + zbx_update_resolver_conf(); /* handle /etc/resolv.conf update */ +#else + ; +#endif } #ifdef _WINDOWS |