Summary: Rogue java processes from lingering stopped services preventing service from returning.
Stopping a java service doesn't kill the java process on occasion, it locks it in a CLOSE_WAIT status endlessly, so port 80 is still being used on the IP when the service attempts to return, thus the service fails to start
Doing a netstat -ano returns the PID of the IP/PORT combination, then I can kill it manually. I'd like to prevent myself from having to do this. I'd like to add to our service restart script a section that will kill any port 80 process in the CLOSE_WAIT status.
I can do this in Linux easily enough:
$ netstat -anp |\
grep ':80 ' |\
grep CLOSE_WAIT |\
awk '{print $7}' |\
cut -d \/ -f1 |\
grep -oE "[[:digit:]]{1,}" |\
xargs kill
But my windows batch scripting skills are pretty sub-par.
Can anyone assist in a windows equivalent to get this done?