BIND 10 trac3186, updated. e76a6be3b3ffbc619ddb36b56e2a30d998ac9c36 [3186] Disabled use of isc::log logging in user_chk hook library.
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Oct 17 12:21:43 UTC 2013
The branch, trac3186 has been updated
via e76a6be3b3ffbc619ddb36b56e2a30d998ac9c36 (commit)
from a27c2a6a18ec14e5c79eae56beb238044ecb87d2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e76a6be3b3ffbc619ddb36b56e2a30d998ac9c36
Author: Thomas Markwalder <tmark at isc.org>
Date: Thu Oct 17 07:44:33 2013 -0400
[3186] Disabled use of isc::log logging in user_chk hook library.
Interrim checkin. Use of isc::logging has been disabled. Initializing
the dictionary (MessageInitializer::loadDictionary) cores on Debian. This
has something to do with the libary being opened and closed without calling
load during Kea configuration parsing and the later reopening the library.
See trac#3198.
-----------------------------------------------------------------------
Summary of changes:
src/hooks/dhcp/user_chk/Makefile.am | 3 ++-
src/hooks/dhcp/user_chk/load_unload.cc | 10 ++++------
src/hooks/dhcp/user_chk/subnet_select_co.cc | 15 ++++++++-------
src/hooks/dhcp/user_chk/tests/Makefile.am | 3 ++-
4 files changed, 16 insertions(+), 15 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/hooks/dhcp/user_chk/Makefile.am b/src/hooks/dhcp/user_chk/Makefile.am
index 623008b..868e306 100644
--- a/src/hooks/dhcp/user_chk/Makefile.am
+++ b/src/hooks/dhcp/user_chk/Makefile.am
@@ -38,7 +38,8 @@ libdhcp_user_chk_la_SOURCES += user_file.cc user_file.h
libdhcp_user_chk_la_SOURCES += user_registry.cc user_registry.h
libdhcp_user_chk_la_SOURCES += version.cc
-nodist_libdhcp_user_chk_la_SOURCES = user_chk_messages.cc user_chk_messages.h
+# Until logging in dynamically loaded libraries is fixed, exclude these.
+#nodist_libdhcp_user_chk_la_SOURCES = user_chk_messages.cc user_chk_messages.h
libdhcp_user_chk_la_CXXFLAGS = $(AM_CXXFLAGS)
libdhcp_user_chk_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
diff --git a/src/hooks/dhcp/user_chk/load_unload.cc b/src/hooks/dhcp/user_chk/load_unload.cc
index 14ee1ee..adc1945 100644
--- a/src/hooks/dhcp/user_chk/load_unload.cc
+++ b/src/hooks/dhcp/user_chk/load_unload.cc
@@ -14,7 +14,6 @@
// load_unload.cc
#include <hooks/hooks.h>
-#include <user_chk_log.h>
#include <user_registry.h>
#include <user_file.h>
@@ -32,9 +31,6 @@ const char* user_chk_output_fname = "/tmp/user_check_output.txt";
extern "C" {
int load(LibraryHandle&) {
-
- isc::log::MessageInitializer::loadDictionary();
-
// non-zero indicates an error.
int ret_val = 0;
try {
@@ -61,7 +57,8 @@ int load(LibraryHandle&) {
}
}
catch (const std::exception& ex) {
- LOG_ERROR(user_chk_logger, USER_CHK_HOOK_LOAD_ERROR).arg(ex.what());
+ std::cout << "DHCP UserCheckHook could not be loaded: "
+ << ex.what() << std::endl;
ret_val = 1;
}
@@ -77,7 +74,8 @@ int unload() {
} catch (const std::exception& ex) {
// On the off chance something goes awry, catch it and log it.
// @todo Not sure if we should return a non-zero result or not.
- LOG_ERROR(user_chk_logger, USER_CHK_HOOK_UNLOAD_ERROR).arg(ex.what());
+ std::cout << "DHCP UserCheckHook could not be unloaded: "
+ << ex.what() << std::endl;
}
return (0);
diff --git a/src/hooks/dhcp/user_chk/subnet_select_co.cc b/src/hooks/dhcp/user_chk/subnet_select_co.cc
index d0bdc69..fe1aaf4 100644
--- a/src/hooks/dhcp/user_chk/subnet_select_co.cc
+++ b/src/hooks/dhcp/user_chk/subnet_select_co.cc
@@ -4,7 +4,6 @@
#include <dhcp/pkt6.h>
#include <dhcpsrv/subnet.h>
#include <user_registry.h>
-#include <user_chk_log.h>
#include <fstream>
#include <string>
@@ -39,7 +38,8 @@ void generate_output_record(const std::string& id_type_str,
// This callout is called at the "subnet4_select" hook.
int subnet4_select(CalloutHandle& handle) {
if (!user_registry) {
- LOG_ERROR(user_chk_logger, USER_CHK_SUBNET4_SELECT_REGISTRY_NULL);
+ std::cout << "DHCP UserCheckHook : subnet4_select UserRegistry is null"
+ << std::endl;
return (1);
}
@@ -73,8 +73,8 @@ int subnet4_select(CalloutHandle& handle) {
false);
}
} catch (const std::exception& ex) {
- LOG_ERROR(user_chk_logger, USER_CHK_SUBNET4_SELECT_ERROR)
- .arg(ex.what());
+ std::cout << "DHCP UserCheckHook : subnet6_select unexpected error: "
+ << ex.what() << std::endl;
return (1);
}
@@ -83,7 +83,8 @@ int subnet4_select(CalloutHandle& handle) {
// This callout is called at the "subnet6_select" hook.
int subnet6_select(CalloutHandle& handle) {
if (!user_registry) {
- LOG_ERROR(user_chk_logger, USER_CHK_SUBNET4_SELECT_REGISTRY_NULL);
+ std::cout << "DHCP UserCheckHook : subnet6_select UserRegistry is null"
+ << std::endl;
return (1);
}
@@ -125,8 +126,8 @@ int subnet6_select(CalloutHandle& handle) {
false);
}
} catch (const std::exception& ex) {
- LOG_ERROR(user_chk_logger, USER_CHK_SUBNET6_SELECT_ERROR)
- .arg(ex.what());
+ std::cout << "DHCP UserCheckHook : subnet6_select unexpected error: "
+ << ex.what() << std::endl;
return (1);
}
diff --git a/src/hooks/dhcp/user_chk/tests/Makefile.am b/src/hooks/dhcp/user_chk/tests/Makefile.am
index 97bac5d..cbd2029 100644
--- a/src/hooks/dhcp/user_chk/tests/Makefile.am
+++ b/src/hooks/dhcp/user_chk/tests/Makefile.am
@@ -35,7 +35,8 @@ libdhcp_user_chk_unittests_SOURCES += ../subnet_select_co.cc
libdhcp_user_chk_unittests_SOURCES += ../version.cc
libdhcp_user_chk_unittests_SOURCES += ../user.cc ../user.h
libdhcp_user_chk_unittests_SOURCES += ../user_chk_log.cc ../user_chk_log.h
-libdhcp_user_chk_unittests_SOURCES += ../user_chk_messages.cc ../user_chk_messages.h
+# Until logging in dynamically loaded libraries is fixed, exclude these.
+#libdhcp_user_chk_unittests_SOURCES += ../user_chk_messages.cc ../user_chk_messages.h
libdhcp_user_chk_unittests_SOURCES += ../user_data_source.cc ../user_data_source.h
libdhcp_user_chk_unittests_SOURCES += ../user_file.cc ../user_file.h
libdhcp_user_chk_unittests_SOURCES += ../user_registry.cc ../user_registry.h
More information about the bind10-changes
mailing list