hisham.i

Active Member
Mar 15, 2011
26
0
51
Hello,
I have servlets on my server, and i added a servlet with an infinite while loop which listens for connection on specific port, but i want to stop this servlet from running, how can i stop it?

Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,222
463
Hello :)

Do you have root access to the server? If so, you kill the process via the command line:

Code:
# kill -9 PID
Thank you.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
You could also always remove the servlet from the machine, then restart Tomcat:

Code:
/scripts/restartsrv_tomcat
I imagine the servlet is a JSP and servlet running via Tomcat. Simply killing the process won't stop Tomcat from trying to reload it again. You'd have to get rid of the file and then restart Tomcat to clear it.