[Bug 290674] net/kea: restart does not work

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 04 Nov 2025 07:10:18 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290674

Jose Luis Duran <jlduran@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #265077|0                           |1
        is obsolete|                            |

--- Comment #16 from Jose Luis Duran <jlduran@FreeBSD.org> ---
Created attachment 265142
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=265142&action=edit
Take 2, use pwait(1)

--- a/src/bin/keactrl/keactrl.in
+++ b/src/bin/keactrl/keactrl.in
@@ -208,6 +208,8 @@ stop_server() {
     # Extract the name of the binary from the path.
     local binary_name
     binary_name=$(basename -- "${binary_path}")
+    # Set a waiting timeout of 5 seconds.
+    local timeout=5

     # Use the binary name to check if the process is already running.
     check_running "${binary_name}"
@@ -218,7 +220,10 @@ stop_server() {
         log_info "Stopping ${binary_name}..."
         if ! kill "-${sig}" "${_pid}"; then
             log_error "Stop failed, could not send signal ${sig} \
-to process ${proc_name}, PID ${_pid}."
+to process ${binary_name}, PID ${_pid}."
+        fi
+        if [ -e "${_pid_file}" ]; then
+            pwait -t "${timeout}" -o "${_pid}" 2> /dev/null
         fi
     fi
 }
@@ -240,7 +245,7 @@ reload_server() {
         log_info "Reloading ${binary_name}..."
         if ! kill "-${sig}" "${_pid}"; then
             log_error "Reload failed, could not send signal ${sig} \
-to process ${proc_name}, PID ${_pid}."
+to process ${binary_name}, PID ${_pid}."
         fi
     fi
 }

-- 
You are receiving this mail because:
You are the assignee for the bug.