]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3769] Addressed review comments
authorThomas Markwalder <tmark@isc.org>
Wed, 8 Jul 2015 13:01:53 +0000 (09:01 -0400)
committerThomas Markwalder <tmark@isc.org>
Wed, 8 Jul 2015 13:01:53 +0000 (09:01 -0400)
Removed Daemon::init() method, improved server log message
descpriptions, and minor typos.

src/bin/d2/d2_messages.mes
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp6/dhcp6_messages.mes
src/lib/dhcpsrv/daemon.cc
src/lib/dhcpsrv/daemon.h
src/lib/dhcpsrv/tests/daemon_unittest.cc
src/lib/testutils/dhcp_test_lib.sh.in
src/lib/util/pid_file.cc

index 383c64f13c76842d8ea5c7854ba4c495897509cd..ee7e995f97f1783956f64d3eb4e56c3f72820170 100644 (file)
@@ -107,7 +107,8 @@ indicates an attempt to start a second instance of DHCP_DDNS using the
 same configuration file.  It is possible, though unlikely, that the PID file
 is a remnant left behind by a server crash or power failure and the PID
 it contains refers to a process other than DHCP_DDNS.  In such an event,
-it would be necessary to manually remove the PID file.
+it would be necessary to manually remove the PID file.  The first argument is
+the DHCP_DDNS process name, the second contains the PID and and PID file.
 
 % DHCP_DDNS_AT_MAX_TRANSACTIONS application has %1 queued requests but has reached maximum number of %2 concurrent transactions
 This is a debug message that indicates that the application has DHCP_DDNS
@@ -292,7 +293,8 @@ its PID file.  The log message should contain details sufficient to
 determine the underlying cause.  The most likely culprits are that
 some portion of the pathname does not exist or a permissions issue. The
 default path is determined by --localstatedir configure paramter but
-may be overridden by setting environment variable, KEA_PIDFILE_DIR.
+may be overridden by setting environment variable, KEA_PIDFILE_DIR.  The
+first argument is the DHCP_DDNS process name.
 
 % DHCP_DDNS_PROCESS_INIT application init invoked
 This is a debug message issued when the DHCP-DDNS application enters
index 9c358abbf495f6a1708f574ca2af58e83c5ab3a1..fb96e908820bad51e311f437c594478ccec90470 100644 (file)
@@ -27,7 +27,8 @@ the server using the same configuration file.  It is possible, though
 unlikely that the PID file is a remnant left behind by a server crash or
 power failure and the PID it contains refers to a process other than
 the server.  In such an event, it would be necessary to manually remove
-the PID file.
+the PID file.  The first argument is the DHCPv4 process name, the
+second contains the PID and and PID file.
 
 % DHCP4_BUFFER_RECEIVED received buffer from %1:%2 to %3:%4 over interface %5
 This debug message is logged when the server has received a packet
index b82e6475e9ac7e6af23dd831170340e6c73b7084..9d0b4fb3d4df21e2e1a1f14de2749e632a6f091d 100644 (file)
@@ -27,7 +27,8 @@ the server using the same configuration file.  It is possible, though
 unlikely that the PID file is a remnant left behind by a server crash or
 power failure and the PID it contains refers to a process other than
 the server.  In such an event, it would be necessary to manually remove
-the PID file.
+the PID file.  The first argument is the DHCPv6 process name, the second
+contains the PID and and PID file.
 
 % DHCP6_ADD_GLOBAL_STATUS_CODE %1: adding Status Code to DHCPv6 packet: %2
 This message is logged when the server is adding the top-level
index a020b0abb2008e3be9ec05dbb76d4832673cc2f5..4ff010a93da2e9393fb57e7f467dd0c9cd4a634a 100644 (file)
@@ -52,10 +52,6 @@ Daemon::~Daemon() {
     }
 }
 
-void Daemon::init(const std::string& config_file) {
-    config_file_ = config_file;
-}
-
 void Daemon::cleanup() {
 
 }
index 94a6e38ab912dd6d952188532be10847c8241dc7..0147401aa69f3807287b016c40da43ad2245765b 100644 (file)
@@ -69,29 +69,6 @@ public:
     /// virtual destructor as well.
     virtual ~Daemon();
 
-    /// @brief Initializes the server.
-    ///
-    /// @todo #3753 - This method should be revisited as its original purpose
-    /// has been lost.  As of #3769, it has been superseded with setConfigFile().
-    /// None of the following is currently accurate.
-    ///
-    /// Depending on the configuration backend, it establishes msgq session,
-    /// or reads the configuration file.
-    ///
-    /// Note: This function may throw to report enountered problems. It may
-    /// also return false if the initialization was skipped. That may seem
-    /// redundant, but the idea here is that in some cases the configuration
-    /// was read, understood and the decision was made to not start. One
-    /// case where such capability could be needed is when we have a single
-    /// config file for Kea4 and D2, but the DNS Update is disabled. It is
-    /// likely that the D2 will be started, it will analyze its config file,
-    /// decide that it is not needed and will shut down.
-    ///
-    /// @note this method may throw
-    ///
-    /// @param config_file Config file name (may be empty if unused).
-    virtual void init(const std::string& config_file);
-
     /// @brief Performs final deconfiguration.
     ///
     /// Performs configuration backend specific final clean-up. This is called
index afc791fe7006b6b590aecdd9bd25b0683bc02d29..e47b332cbc031d56093d2e78329d445298a0c1a7 100644 (file)
@@ -78,10 +78,10 @@ TEST_F(DaemonTest, constructor) {
     Daemon instance2;
     EXPECT_FALSE(instance2.getVerbose());
 
-    EXPECT_EQ("",instance2.getConfigFile());
-    EXPECT_EQ("",instance2.getProcName());
+    EXPECT_TRUE(instance2.getConfigFile().empty());
+    EXPECT_TRUE(instance2.getProcName().empty());
     EXPECT_EQ(CfgMgr::instance().getDataDir(),instance2.getPIDFileDir());
-    EXPECT_EQ("",instance2.getPIDFileName());
+    EXPECT_TRUE(instance2.getPIDFileName().empty());
 }
 
 // Verify config file accessors
index a07cc473398c375d774d423a550cae1efc56505b..dd542324eeec1dc1f3b361852b9ade0e79eea748 100644 (file)
@@ -447,7 +447,7 @@ verify_server_pid() {
         clean_exit 1
     fi
 
-    # Only the file name portio of the config file is used, try and
+    # Only the file name portion of the config file is used, try and
     # extract it. NOTE if this "algorithm" changes this code will need
     # to be updated.
     fname=`basename ${cfg_file}`
index 9ebd1be73d94d7e2495ee2c20a4327a242f2aef7..42bde7e3cc74c8a7f38c54bef68d763665d5e60c 100644 (file)
@@ -51,7 +51,7 @@ PIDFile::check() const {
                   << filename_ << "'");
     }
 
-    // If the process is still running return true
+    // If the process is still running return its pid.
     if (kill(pid, 0) == 0) {
         return (pid);
     }