Skip to content

Commit 3ddcad1

Browse files
jrcoakona-agent
andcommitted
Fix startup script hanging issue with lsof command
- Add error suppression and head -1 to prevent infinite loop in kill_port function - Resolves startup script hanging when checking for processes on ports Co-authored-by: Ona <no-reply@ona.com>
1 parent 402bf0d commit 3ddcad1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

startup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ check_port() {
6666
# Function to kill process on port
6767
kill_port() {
6868
local port=$1
69-
local pid=$(lsof -ti:$port)
69+
local pid=$(lsof -ti:$port 2>/dev/null | head -1)
7070
if [ ! -z "$pid" ]; then
7171
print_warning "Killing process on port $port (PID: $pid)"
7272
kill -9 $pid 2>/dev/null || true

0 commit comments

Comments
 (0)