mirror of
https://github.com/2dust/v2rayN.git
synced 2026-08-11 01:32:06 +03:00
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:
@@ -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 "============================================"
|
||||
|
||||
Reference in New Issue
Block a user