mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-10 23:27:56 -05:00
explorerd: improve process termination in 'stop' makefile target
This commit enhances the process termination mechanism in the 'stop' target by: - Adding a check to verify that a PID is running before attempting to terminate it - Implementing a more graceful termination approach by first sending SIGTERM (15) and only using SIGKILL (9) as a fallback
This commit is contained in:
@@ -138,10 +138,11 @@ check-minerd:
|
||||
stop:
|
||||
@if [ -f PIDs.txt ]; then \
|
||||
while read PID; do \
|
||||
kill $$PID 2>/dev/null || echo "Unable to kill PID $$PID"; \
|
||||
if ps -p $$PID > /dev/null 2>&1; then \
|
||||
kill -15 $$PID 2>/dev/null; sleep 5; ps -p $$PID > /dev/null 2>&1 && kill -9 $$PID 2>/dev/null; \
|
||||
fi; \
|
||||
done < PIDs.txt; \
|
||||
rm -f PIDs.txt; \
|
||||
sleep 5; \
|
||||
echo "Stopped explorer node environment"; \
|
||||
else \
|
||||
if [ "$(suppress_not_running)" != "1" ]; then \
|
||||
|
||||
Reference in New Issue
Block a user