Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to program a server software which involves a lot of testing on java / scala platform. Whenever i compile and execute the code. It starts listening on port 80. Sometimes i need to terminate it by Ctrl+C when it hangs. In that case, ubuntu is not freeing the port. So in order to run the process, i have to restart the machine.

I see this at ps aux

root      1924  0.0  0.0   5796  1660 pts/0    T    05:44   0:00 sudo scala -
root      1925  0.2  1.5 491448 40796 pts/0    Tl   05:44   0:03 java -Xmx256M -Xms16M

So process 1924 and 1925. I did sudo kill on both these. But then they keep on persisting even after a long time.

sudo nmap -T Aggressive -A -v -p 1-65000

Scanning localhost ( [65000 ports]

Discovered open port 80/tcp on

It means its still there !

sudo netstat --tcp --udp --listening --program

tcp6       0      0 [::]:www                [::]:*                  LISTEN      1925/java
tcp6       0      0 ip6-localhost:ipp       [::]:*                  LISTEN      1185/cupsd

This means its 1925 - java

How to kill it.

share|improve this question
Try kill -9 1925 (the -9 changes the signal to SIGKILL, which forces termination) – cyberx86 Nov 25 '11 at 0:50
Worked ! Thanks. – Aditya Singh Nov 25 '11 at 1:07

kill -9 sends a SIGKILL which allows you to kill any process that isn't waiting on IO.

A regular kill just sends SIGTERM which only asks the process to quit. Whereas SIGKILL tells the OS to immediately terminate the process.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.