I'm using tomcat, and sometimes when I tell it to stop it doesn't properly kill the process.
My way around this is too do:
lsof -i tcp:8080
which outputs:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 888 root 35u IPv6 780659 0t0 TCP *:http-alt (LISTEN)
java 888 root 39r IPv6 790103 0t0 TCP localhost:58916->localhost:http-alt (CLOSE_WAIT)
java 888 root 40r IPv6 792585 0t0 TCP localhost:58936->localhost:http-alt (CLOSE_WAIT)
java 888 root 75r IPv6 785553 0t0 TCP localhost:58701->localhost:http-alt (CLOSE_WAIT)
java 888 root 77r IPv6 787642 0t0 TCP localhost:58814->localhost:http-alt (CLOSE_WAIT)
java 888 root 130u IPv6 783894 0t0 TCP localhost:58686->localhost:http-alt (CLOSE_WAIT)
java 888 root 353u IPv6 780929 0t0 TCP localhost:58632->localhost:http-alt (CLOSE_WAIT)
I then run
kill -9 pid
I want a way to get all the pid numbers and kill them. Thing is I don't know how to isolate that field.
tomcat
process open, you can usekillall -9 tomcat