--- bin/named/server.c.orig 2012-03-01 14:49:19.000000000 -0800 +++ bin/named/server.c 2012-03-01 14:48:51.000000000 -0800 @@ -5217,21 +5217,6 @@ return (result); } -#ifdef HAVE_GEOIP -static isc_result_t -load_geoip(ns_server_t *server) { - isc_result_t result; - - result = isc_task_beginexclusive(server->task); - RUNTIME_CHECK(result == ISC_R_SUCCESS); - - geoip_init(); - - isc_task_endexclusive(server->task); - return (result); -} -#endif /* HAVE_GEOIP */ - static isc_result_t view_loaded(void *arg) { isc_result_t result; @@ -5260,11 +5245,6 @@ CHECKFATAL(dns_zonemgr_forcemaint(server->zonemgr), "forcing zone maintenance"); -#ifdef HAVE_GEOIP - /* Load GeoIP DBs */ - CHECKFATAL(load_geoip(server), "loading GeoIP"); -#endif /* HAVE_GEOIP */ - ns_os_started(); isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ISC_LOG_NOTICE, "running"); @@ -5272,6 +5252,21 @@ return (ISC_R_SUCCESS); } +#ifdef HAVE_GEOIP +static isc_result_t +load_geoip(ns_server_t *server) { + isc_result_t result; + + result = isc_task_beginexclusive(server->task); + RUNTIME_CHECK(result == ISC_R_SUCCESS); + + geoip_init(); + + isc_task_endexclusive(server->task); + return (result); +} +#endif /* HAVE_GEOIP */ + static isc_result_t load_zones(ns_server_t *server) { isc_result_t result; @@ -5407,6 +5402,11 @@ isc_hash_init(); CHECKFATAL(load_zones(server), "loading zones"); + +#ifdef HAVE_GEOIP + /* Load GeoIP DBs */ + CHECKFATAL(load_geoip(server), "loading GeoIP"); +#endif /* HAVE_GEOIP */ } void @@ -5851,9 +5851,19 @@ NS_LOGMODULE_SERVER, ISC_LOG_ERROR, "reloading zones failed: %s", isc_result_totext(result)); + #ifdef HAVE_GEOIP /* Reload GeoIP DBs */ - load_geoip(server); + result = load_geoip(server); + if (result == ISC_R_SUCCESS) + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_INFO, + "reloading GeoIP succeeded"); + else + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_ERROR, + "reloading GeoIP failed: %s", + isc_result_totext(result)); #endif /* HAVE_GEOIP */ cleanup: