Browse Source

[2617] added "exiting" log message to those that don't have it until now.

JINMEI Tatuya 12 years ago
parent
commit
266bfcd67a

+ 3 - 0
src/bin/auth/auth_messages.mes

@@ -312,6 +312,9 @@ been created and is initializing. The AUTH_SERVER_STARTED message will be
 output when initialization has successfully completed and the server starts
 output when initialization has successfully completed and the server starts
 accepting queries.
 accepting queries.
 
 
+% AUTH_SERVER_EXITING exiting
+The authoritative server is exiting.
+
 % AUTH_SERVER_FAILED server failed: %1
 % AUTH_SERVER_FAILED server failed: %1
 The authoritative server has encountered a fatal error and is terminating. The
 The authoritative server has encountered a fatal error and is terminating. The
 reason for the failure is included in the message.
 reason for the failure is included in the message.

+ 16 - 16
src/bin/auth/main.cc

@@ -44,6 +44,7 @@
 #include <server_common/socket_request.h>
 #include <server_common/socket_request.h>
 
 
 #include <boost/bind.hpp>
 #include <boost/bind.hpp>
+#include <boost/scoped_ptr.hpp>
 
 
 #include <sys/types.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/socket.h>
@@ -152,10 +153,11 @@ main(int argc, char* argv[]) {
     int ret = 0;
     int ret = 0;
 
 
     // XXX: we should eventually pass io_service here.
     // XXX: we should eventually pass io_service here.
-    Session* cc_session = NULL;
-    Session* xfrin_session = NULL;
+    boost::scoped_ptr<AuthSrv> auth_server_; // placeholder
+    boost::scoped_ptr<Session> cc_session;
+    boost::scoped_ptr<Session> xfrin_session;
     bool xfrin_session_established = false; // XXX (see Trac #287)
     bool xfrin_session_established = false; // XXX (see Trac #287)
-    ModuleCCSession* config_session = NULL;
+    boost::scoped_ptr<ModuleCCSession> config_session;
     XfroutClient xfrout_client(getXfroutSocketPath());
     XfroutClient xfrout_client(getXfroutSocketPath());
     SocketSessionForwarder ddns_forwarder(getDDNSSocketPath());
     SocketSessionForwarder ddns_forwarder(getDDNSSocketPath());
     try {
     try {
@@ -167,7 +169,8 @@ main(int argc, char* argv[]) {
             specfile = string(AUTH_SPECFILE_LOCATION);
             specfile = string(AUTH_SPECFILE_LOCATION);
         }
         }
 
 
-        auth_server = new AuthSrv(xfrout_client, ddns_forwarder);
+        auth_server_.reset(new AuthSrv(xfrout_client, ddns_forwarder));
+        auth_server = auth_server_.get();
         LOG_INFO(auth_logger, AUTH_SERVER_CREATED);
         LOG_INFO(auth_logger, AUTH_SERVER_CREATED);
 
 
         SimpleCallback* checkin = auth_server->getCheckinProvider();
         SimpleCallback* checkin = auth_server->getCheckinProvider();
@@ -179,7 +182,7 @@ main(int argc, char* argv[]) {
         auth_server->setDNSService(dns_service);
         auth_server->setDNSService(dns_service);
         LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_DNS_SERVICES_CREATED);
         LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_DNS_SERVICES_CREATED);
 
 
-        cc_session = new Session(io_service.get_io_service());
+        cc_session.reset(new Session(io_service.get_io_service()));
         LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_CONFIG_CHANNEL_CREATED);
         LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_CONFIG_CHANNEL_CREATED);
         // Initialize the Socket Requestor
         // Initialize the Socket Requestor
         isc::server_common::initSocketRequestor(*cc_session, AUTH_NAME);
         isc::server_common::initSocketRequestor(*cc_session, AUTH_NAME);
@@ -191,18 +194,18 @@ main(int argc, char* argv[]) {
         // updateConfig() for listen_on and in initializing TSIG keys below).
         // updateConfig() for listen_on and in initializing TSIG keys below).
         // Until then all operations on the CC session will take place
         // Until then all operations on the CC session will take place
         // synchronously.
         // synchronously.
-        config_session = new ModuleCCSession(specfile, *cc_session,
-                                             my_config_handler,
-                                             my_command_handler, false);
+        config_session.reset(new ModuleCCSession(specfile, *cc_session,
+                                                 my_config_handler,
+                                                 my_command_handler, false));
         LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_CONFIG_CHANNEL_ESTABLISHED);
         LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_CONFIG_CHANNEL_ESTABLISHED);
 
 
-        xfrin_session = new Session(io_service.get_io_service());
+        xfrin_session.reset(new Session(io_service.get_io_service()));
         LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_XFRIN_CHANNEL_CREATED);
         LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_XFRIN_CHANNEL_CREATED);
         xfrin_session->establish(NULL);
         xfrin_session->establish(NULL);
         xfrin_session_established = true;
         xfrin_session_established = true;
         LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_XFRIN_CHANNEL_ESTABLISHED);
         LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_XFRIN_CHANNEL_ESTABLISHED);
 
 
-        auth_server->setXfrinSession(xfrin_session);
+        auth_server->setXfrinSession(xfrin_session.get());
 
 
         // Configure the server.  configureAuthServer() is expected to install
         // Configure the server.  configureAuthServer() is expected to install
         // all initial configurations, but as a short term workaround we
         // all initial configurations, but as a short term workaround we
@@ -210,7 +213,7 @@ main(int argc, char* argv[]) {
         // updateConfig().
         // updateConfig().
         // if server load configure failed, we won't exit, give user second
         // if server load configure failed, we won't exit, give user second
         // chance to correct the configure.
         // chance to correct the configure.
-        auth_server->setConfigSession(config_session);
+        auth_server->setConfigSession(config_session.get());
         try {
         try {
             configureAuthServer(*auth_server, config_session->getFullConfig());
             configureAuthServer(*auth_server, config_session->getFullConfig());
             auth_server->updateConfig(ElementPtr());
             auth_server->updateConfig(ElementPtr());
@@ -228,7 +231,7 @@ main(int argc, char* argv[]) {
         config_session->addRemoteConfig("data_sources",
         config_session->addRemoteConfig("data_sources",
                                         boost::bind(datasrcConfigHandler,
                                         boost::bind(datasrcConfigHandler,
                                                     auth_server, &first_time,
                                                     auth_server, &first_time,
-                                                    config_session,
+                                                    config_session.get(),
                                                     _1, _2, _3),
                                                     _1, _2, _3),
                                         false);
                                         false);
 
 
@@ -260,10 +263,7 @@ main(int argc, char* argv[]) {
         config_session->removeRemoteConfig("data_sources");
         config_session->removeRemoteConfig("data_sources");
     }
     }
 
 
-    delete xfrin_session;
-    delete config_session;
-    delete cc_session;
-    delete auth_server;
+    LOG_INFO(auth_logger, AUTH_SERVER_EXITING);
 
 
     return (ret);
     return (ret);
 }
 }

+ 2 - 0
src/bin/cmdctl/cmdctl.py.in

@@ -650,4 +650,6 @@ if __name__ == '__main__':
     if httpd:
     if httpd:
         httpd.shutdown()
         httpd.shutdown()
 
 
+    logger.info(CMDCTL_EXITING)
+
     sys.exit(result)
     sys.exit(result)

+ 3 - 0
src/bin/cmdctl/cmdctl_messages.mes

@@ -43,6 +43,9 @@ specific error is printed in the message.
 This debug message indicates that the given command has been sent to
 This debug message indicates that the given command has been sent to
 the given module.
 the given module.
 
 
+% CMDCTL_EXITING exiting
+The b10-cmdctl daemon is exiting.
+
 % CMDCTL_NO_SUCH_USER username not found in user database: %1
 % CMDCTL_NO_SUCH_USER username not found in user database: %1
 A login attempt was made to b10-cmdctl, but the username was not known.
 A login attempt was made to b10-cmdctl, but the username was not known.
 Users can be added with the tool b10-cmdctl-usermgr.
 Users can be added with the tool b10-cmdctl-usermgr.

+ 2 - 0
src/bin/msgq/msgq.py.in

@@ -815,3 +815,5 @@ if __name__ == "__main__":
         pass
         pass
 
 
     msgq.shutdown()
     msgq.shutdown()
+
+    logger.info(MSGQ_EXITING)

+ 3 - 0
src/bin/msgq/msgq_messages.mes

@@ -59,6 +59,9 @@ the message queue version and version of the module.
 % MSGQ_CONFIG_DATA Received configuration update for the msgq: %1
 % MSGQ_CONFIG_DATA Received configuration update for the msgq: %1
 Debug message. The message queue received a configuration update, handling it.
 Debug message. The message queue received a configuration update, handling it.
 
 
+% MSGQ_EXITING exiting
+The msgq daemon is exiting.
+
 % MSGQ_HDR_DECODE_ERR Error decoding header received from socket %1: %2
 % MSGQ_HDR_DECODE_ERR Error decoding header received from socket %1: %2
 The socket with mentioned file descriptor sent a packet. However, it was not
 The socket with mentioned file descriptor sent a packet. However, it was not
 possible to decode the routing header of the packet. The packet is ignored.
 possible to decode the routing header of the packet. The packet is ignored.

+ 2 - 0
src/bin/stats/stats.py.in

@@ -696,3 +696,5 @@ if __name__ == "__main__":
         sys.exit(1)
         sys.exit(1)
     except KeyboardInterrupt as kie:
     except KeyboardInterrupt as kie:
         logger.info(STATS_STOPPED_BY_KEYBOARD)
         logger.info(STATS_STOPPED_BY_KEYBOARD)
+
+    logger.info(STATS_EXITING)

+ 2 - 0
src/bin/stats/stats_httpd.py.in

@@ -631,3 +631,5 @@ if __name__ == "__main__":
         sys.exit(1)
         sys.exit(1)
     except KeyboardInterrupt as kie:
     except KeyboardInterrupt as kie:
         logger.info(STATSHTTPD_STOPPED_BY_KEYBOARD)
         logger.info(STATSHTTPD_STOPPED_BY_KEYBOARD)
+
+    logger.info(STATSHTTPD_EXITING)

+ 9 - 6
src/bin/stats/stats_httpd_messages.mes

@@ -32,10 +32,19 @@ address and port number.
 Debug message indicating that the stats-httpd module is disconnecting
 Debug message indicating that the stats-httpd module is disconnecting
 from the command and control bus.
 from the command and control bus.
 
 
+% STATSHTTPD_EXITING exiting
+The stats HTTP server is exiting.
+
 % STATSHTTPD_HANDLE_CONFIG reading configuration: %1
 % STATSHTTPD_HANDLE_CONFIG reading configuration: %1
 The stats-httpd daemon has received new configuration data and will now
 The stats-httpd daemon has received new configuration data and will now
 process it. The (changed) data is printed.
 process it. The (changed) data is printed.
 
 
+% STATSHTTPD_HTTPLOG %1 %2
+Debug HTTP log message. These are the messages logged by the http server
+instance. For most logs, the message shows HTTP client and query
+information like HTTP method, URI, and status code, but the http server
+can also log other information, such as extended status reports.
+
 % STATSHTTPD_RECEIVED_SHUTDOWN_COMMAND shutdown command received
 % STATSHTTPD_RECEIVED_SHUTDOWN_COMMAND shutdown command received
 A shutdown command was sent to the stats-httpd module, and it will
 A shutdown command was sent to the stats-httpd module, and it will
 now shut down.
 now shut down.
@@ -96,9 +105,3 @@ configuration is unknown. The new configuration is ignored, and an
 error is sent back. As possible cause is that there was an upgrade
 error is sent back. As possible cause is that there was an upgrade
 problem, and the stats-httpd version is out of sync with the rest of
 problem, and the stats-httpd version is out of sync with the rest of
 the system.
 the system.
-
-% STATSHTTPD_HTTPLOG %1 %2
-Debug HTTP log message. These are the messages logged by the http server
-instance. For most logs, the message shows HTTP client and query
-information like HTTP method, URI, and status code, but the http server
-can also log other information, such as extended status reports.

+ 3 - 0
src/bin/stats/stats_messages.mes

@@ -24,6 +24,9 @@ The stats module was unable to connect to the BIND 10 command and
 control bus. A likely problem is that the message bus daemon
 control bus. A likely problem is that the message bus daemon
 (b10-msgq) is not running. The stats module will now shut down.
 (b10-msgq) is not running. The stats module will now shut down.
 
 
+% STATS_EXITING exiting
+The stats module process is exiting.
+
 % STATS_RECEIVED_INVALID_STATISTICS_DATA received invalid statistics data from %1
 % STATS_RECEIVED_INVALID_STATISTICS_DATA received invalid statistics data from %1
 Invalid statistics data has been received from the module while
 Invalid statistics data has been received from the module while
 polling and it has been discarded.
 polling and it has been discarded.

+ 2 - 0
src/bin/xfrin/xfrin.py.in

@@ -1738,5 +1738,7 @@ def main(xfrin_class, use_signal=True):
     if xfrind:
     if xfrind:
         xfrind.shutdown()
         xfrind.shutdown()
 
 
+    logger.info(XFRIN_EXITING)
+
 if __name__ == '__main__':
 if __name__ == '__main__':
     main(Xfrin)
     main(Xfrin)

+ 3 - 0
src/bin/xfrin/xfrin_messages.mes

@@ -60,6 +60,9 @@ error is given in the log message.
 There was an error opening a connection to the master. The error is
 There was an error opening a connection to the master. The error is
 shown in the log message.
 shown in the log message.
 
 
+% XFRIN_EXITING exiting
+The xfrin daemon is exiting.
+
 % XFRIN_GOT_INCREMENTAL_RESP got incremental response for %1
 % XFRIN_GOT_INCREMENTAL_RESP got incremental response for %1
 In an attempt of IXFR processing, the beginning SOA of the first difference
 In an attempt of IXFR processing, the beginning SOA of the first difference
 (following the initial SOA that specified the final SOA for all the
 (following the initial SOA that specified the final SOA for all the

+ 2 - 1
src/bin/xfrout/xfrout.py.in

@@ -1274,7 +1274,7 @@ if '__main__' == __name__:
         xfrout_server = XfroutServer()
         xfrout_server = XfroutServer()
         xfrout_server.run()
         xfrout_server.run()
     except KeyboardInterrupt:
     except KeyboardInterrupt:
-        logger.INFO(XFROUT_STOPPED_BY_KEYBOARD)
+        logger.info(XFROUT_STOPPED_BY_KEYBOARD)
     except SessionError as e:
     except SessionError as e:
         logger.error(XFROUT_CC_SESSION_ERROR, str(e))
         logger.error(XFROUT_CC_SESSION_ERROR, str(e))
     except ModuleCCSessionError as e:
     except ModuleCCSessionError as e:
@@ -1287,3 +1287,4 @@ if '__main__' == __name__:
     if xfrout_server:
     if xfrout_server:
         xfrout_server.shutdown()
         xfrout_server.shutdown()
 
 
+    logger.info(XFROUT_EXITING)

+ 3 - 0
src/bin/xfrout/xfrout_messages.mes

@@ -32,6 +32,9 @@ configuration manager b10-cfgmgr is not running.
 The xfrout process encountered an error when installing the configuration at
 The xfrout process encountered an error when installing the configuration at
 startup time.  Details of the error are included in the log message.
 startup time.  Details of the error are included in the log message.
 
 
+% XFROUT_EXITING exiting
+The xfrout daemon is exiting.
+
 % XFROUT_FETCH_REQUEST_ERROR socket error while fetching a request from the auth daemon
 % XFROUT_FETCH_REQUEST_ERROR socket error while fetching a request from the auth daemon
 There was a socket error while contacting the b10-auth daemon to
 There was a socket error while contacting the b10-auth daemon to
 fetch a transfer request. The auth daemon may have shutdown.
 fetch a transfer request. The auth daemon may have shutdown.

+ 1 - 1
src/bin/zonemgr/zonemgr.py.in

@@ -714,4 +714,4 @@ if '__main__' == __name__:
     if zonemgrd and zonemgrd.running:
     if zonemgrd and zonemgrd.running:
         zonemgrd.shutdown()
         zonemgrd.shutdown()
 
 
-    logger.debug(DBG_START_SHUT, ZONEMGR_SHUTDOWN)
+    logger.info(ZONEMGR_SHUTDOWN)

+ 1 - 1
src/bin/zonemgr/zonemgr_messages.mes

@@ -114,7 +114,7 @@ connecting to the command channel daemon.  The most usual cause of this
 problem is that the daemon is not running.
 problem is that the daemon is not running.
 
 
 % ZONEMGR_SHUTDOWN zone manager has shut down
 % ZONEMGR_SHUTDOWN zone manager has shut down
-A debug message, output when the zone manager has shut down completely.
+The zone manager has shut down completely.
 
 
 % ZONEMGR_STARTED zonemgr started
 % ZONEMGR_STARTED zonemgr started
 This informational message is output by zonemgr when all initialization
 This informational message is output by zonemgr when all initialization