]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4090] Finished fix
authorFrancis Dupont <fdupont@isc.org>
Tue, 23 Sep 2025 21:48:52 +0000 (23:48 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 25 Sep 2025 19:20:32 +0000 (21:20 +0200)
src/lib/dhcpsrv/memfile_lease_mgr.cc

index e35f4dfa31673c08e7b516d66691a436c1c0fd9b..e6f85151d758e0bbb1b041365076dd6f3d835611 100644 (file)
@@ -240,30 +240,12 @@ LFCSetup::execute(const std::string& lease_file) {
     try {
         // Look at lfc.dox for a description of this.
 
-        // Try to recover a deleted pid file.
-        bool is_running = false;
-        if (pid_ != 0) {
-            try {
-                is_running = isRunning();
-            } catch (...) {
-                // Ignore errors.
-            }
-        }
-        // Do not trust the process spawn isRunning method.
-        if (is_running && (kill(pid_, 0) != 0)) {
-            is_running = false;
-        }
-
         // Try to acquire the lock for the pid file.
         PIDLock pid_lock(pid_file.getLockname());
 
         // Verify that no lfc is still running.
-        if (is_running || !pid_lock.isLocked() || pid_file.check()) {
+        if (!pid_lock.isLocked() || pid_file.check()) {
             LOG_INFO(dhcpsrv_logger, DHCPSRV_MEMFILE_LFC_RUNNING);
-            if (is_running && pid_lock.isLocked() && !pid_file.check()) {
-                // The pid file was deleted and the process is still running!
-                pid_file.write(pid_);
-            }
             return;
         }