I have a problem with one of my gameservers. Sometimes it just hangs and nothing's happening anymore.
I need a script, that could detect this sort of state, kill the process and restart it.
If the process would just exit, it wouldn't be a deal to write a script, but since it just gets stuck, it's more of a problem for me... It's not consuming 100% CPU or RAM so this way isn't possible either.
And yes, I've already googled and did search for solutions but I haven't found any yet...
I came up with this idea:
The gameserver listens to a certain port. When it crashes does it still listen or is it declared as open but not listened since any data transferred through the port will be blocked cause the process is not running anymore?
So may it be possible to check with netstat if the port is listened, when it doesn't it should restart it?
Could that be a way? (Btw. nmap is not possible, Im filtering almost everything)
I hope someone can help me with this problem.