Wait briefly after sudo process kills

https://github.com/2dust/v2rayN/issues/9863
Add a short 1-second delay after terminating core processes on Linux, macOS, and in CoreAdminManager so ports and process resources have time to settle before the next step runs.
This commit is contained in:
2dust
2026-08-05 17:03:23 +08:00
parent b27ae11d1e
commit d381d429e4
3 changed files with 12 additions and 0 deletions
@@ -91,6 +91,8 @@ public class CoreAdminManager
.ExecuteBufferedAsync();
await UpdateFunc(false, result.StandardOutput.ToString());
await Task.Delay(1000); // Wait for a second to ensure the process is killed
}
catch (Exception ex)
{
@@ -66,6 +66,11 @@ kill_children "$PID"
echo "Terminating main process: $PID"
kill -9 "$PID" 2>/dev/null || true
# Wait a little for process/port resources to be fully released
FINAL_WAIT_SECONDS=1
echo "Waiting ${FINAL_WAIT_SECONDS}s for resources to settle..."
sleep "$FINAL_WAIT_SECONDS"
echo "============================================"
echo "Process $PID and all its children have been terminated"
echo "============================================"
@@ -63,6 +63,11 @@ kill_descendants "$PID"
echo "Terminating main process: $PID"
kill -9 "$PID" 2>/dev/null || true
# Wait a little for process/port resources to be fully released
FINAL_WAIT_SECONDS=1
echo "Waiting ${FINAL_WAIT_SECONDS}s for resources to settle..."
sleep "$FINAL_WAIT_SECONDS"
echo "============================================"
echo "Process $PID and all its descendants have been terminated"
echo "============================================"