From: Francis Dupont Date: Tue, 23 Sep 2025 21:48:52 +0000 (+0200) Subject: [#4090] Finished fix X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7fd0a9ca42f5185496cb856e738b65196a8838a8;p=thirdparty%2Fkea.git [#4090] Finished fix --- diff --git a/src/lib/dhcpsrv/memfile_lease_mgr.cc b/src/lib/dhcpsrv/memfile_lease_mgr.cc index e35f4dfa31..e6f85151d7 100644 --- a/src/lib/dhcpsrv/memfile_lease_mgr.cc +++ b/src/lib/dhcpsrv/memfile_lease_mgr.cc @@ -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; }