Answer the question
In order to leave comments, you need to log in
When you try to kill the process, it hangs stupidly, but does not die. What to do?
There is a server Unturned.exe. Which can sometimes freeze, for many reasons.
To do this, I found a script that automatically, when a freeze is detected, restarts the process, that is, it kills the hung one and starts a new one.
BAT code:
@ECHO OFF
:CHECK
TASKLIST /NH /FI "IMAGENAME EQ Unturned.exe" /FI "STATUS EQ RUNNING" | FIND /I ":" > NUL
IF %ERRORLEVEL%==0 GOTO NOT_RUNNING
TIMEOUT /T 10 /NOBREAK
GOTO CHECK
:NOT_RUNNING
TASKKILL /IM Unturned.exe
START Unturned.exe -pvp -port:25444 -normal -pei -players:32 -sv -nographics -nosync
TIMEOUT /T 10 /NOBREAK
GOTO CHECK
Answer the question
In order to leave comments, you need to log in
This happens because the termination signal is given to the main thread of the application, and this main thread at this time may be dependent on another one, which is just not responding. Those. the application would be happy to close, but the signal has not yet reached the main application thread.
You can monitor this through the "Resource Monitor", where you can see the chain of expectations.
Accordingly, having completed the expected thread, the required one will also end.
My "answer" is purely for reference. Partial solution posted above.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question