|
@@ -23,13 +23,13 @@ using namespace isc::d2;
|
|
|
using namespace std;
|
|
|
|
|
|
/// This file contains entry point (main() function) for standard DHCP-DDNS
|
|
|
-/// process, b10-d2, component for BIND10 framework. It parses command-line
|
|
|
-/// arguments and instantiates D2Controller class that is responsible for
|
|
|
-/// establishing connection with msgq (receiving commands and configuration)
|
|
|
+/// process, b10-d2, component for BIND10 framework. It parses command-line
|
|
|
+/// arguments and instantiates D2Controller class that is responsible for
|
|
|
+/// establishing connection with msgq (receiving commands and configuration)
|
|
|
/// and also creating D2Server object as well.
|
|
|
///
|
|
|
/// For detailed explanation or relations between main(), D2Controller,
|
|
|
-/// D2Server and other classes, see \ref d2Session.
|
|
|
+/// D2Server and other classes, see \ref d2Session.
|
|
|
|
|
|
namespace {
|
|
|
|
|
@@ -38,8 +38,8 @@ const char* const D2_NAME = "b10-d2";
|
|
|
void
|
|
|
usage() {
|
|
|
cerr << "Usage: " << D2_NAME << " [-v] [-s]" << endl;
|
|
|
- cerr << " -v: verbose output" << endl;
|
|
|
cerr << " -s: stand-alone mode (don't connect to BIND10)" << endl;
|
|
|
+ cerr << " -v: verbose output (only when in stand-alone mode" << endl;
|
|
|
exit(EXIT_FAILURE);
|
|
|
}
|
|
|
} // end of anonymous namespace
|
|
@@ -48,11 +48,10 @@ int
|
|
|
main(int argc, char* argv[]) {
|
|
|
int ch;
|
|
|
|
|
|
- // NOTE these parameters are preliminary only. They are here to
|
|
|
+ // @TODO NOTE these parameters are preliminary only. They are here to
|
|
|
// for symmetry with the DHCP servers. They may or may not
|
|
|
// become part of the eventual implementation.
|
|
|
|
|
|
-
|
|
|
bool stand_alone = false; // Should be connect to BIND10 msgq?
|
|
|
bool verbose_mode = false; // Should server be verbose?
|
|
|
|
|
@@ -78,16 +77,17 @@ main(int argc, char* argv[]) {
|
|
|
|
|
|
// Initialize logging. If verbose, we'll use maximum verbosity.
|
|
|
// If standalone is enabled, do not buffer initial log messages
|
|
|
+ // Verbose logging is only enabled when in stand alone mode.
|
|
|
isc::log::initLogger(D2_NAME,
|
|
|
- (verbose_mode ? isc::log::DEBUG : isc::log::INFO),
|
|
|
+ ((verbose_mode && stand_alone)
|
|
|
+ ? isc::log::DEBUG : isc::log::INFO),
|
|
|
isc::log::MAX_DEBUG_LEVEL, NULL, !stand_alone);
|
|
|
LOG_INFO(d2_logger, D2_STARTING);
|
|
|
LOG_DEBUG(d2_logger, DBGLVL_START_SHUT, D2_START_INFO)
|
|
|
.arg(getpid()).arg(verbose_mode ? "yes" : "no")
|
|
|
.arg(stand_alone ? "yes" : "no" );
|
|
|
|
|
|
-
|
|
|
- // For now we will sleep awhile to simulate doing something.
|
|
|
+ // For now we will sleep awhile to simulate doing something.
|
|
|
// Without at least a sleep, the process will start, exit and be
|
|
|
// restarted by Bind10/Init endlessley in a rapid succession.
|
|
|
sleep(1000);
|