From: Stephen Morris Date: Fri, 11 Jan 2013 08:37:15 +0000 (+0000) Subject: [2559] Add debug message when database is closed X-Git-Tag: bind10-1.0.0-rc-release~76^2~21^2~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f4e272c729e2a77f720b06a22819013f6695f06b;p=thirdparty%2Fkea.git [2559] Add debug message when database is closed --- diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.mes b/src/lib/dhcpsrv/dhcpsrv_messages.mes index 27f12fc947..ee057dfec8 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.mes +++ b/src/lib/dhcpsrv/dhcpsrv_messages.mes @@ -60,6 +60,13 @@ This is a debug message reporting that the DHCP configuration manager has returned the specified IPv6 subnet when given the address hint specified as the address is within the subnet. +% DHCPSRV_CLOSE_DB closing currently open %1 database +This is a debug message, issues when the DHCP server closed the currently +open lease database. It is issued at program shutdown, and whenever +the database access parameters are changed: in the latter case, the +server closes the currently open database, and opens a database using +the new parameters. + % DHCPSRV_INVALID_ACCESS invalid database access string: %1 This is logged when an attempt has been made to parse a database access string and the attempt ended in error. The access string in question - which diff --git a/src/lib/dhcpsrv/lease_mgr_factory.cc b/src/lib/dhcpsrv/lease_mgr_factory.cc index 9fd276d9ac..ad31d125f2 100644 --- a/src/lib/dhcpsrv/lease_mgr_factory.cc +++ b/src/lib/dhcpsrv/lease_mgr_factory.cc @@ -141,6 +141,12 @@ LeaseMgrFactory::create(const std::string& dbaccess) { void LeaseMgrFactory::destroy() { + // Destroy current lease manager. This is a no-op if no lease manager + // is available. + if (getLeaseMgrPtr()) { + LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE, DHCPSRV_CLOSE_DB) + .arg(getLeaseMgrPtr()->getType()); + } getLeaseMgrPtr().reset(); }