Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 127.0.0.1 -p 1-65000

Scanning localhost (127.0.0.1) [65000 ports]

Discovered open port 80/tcp on 127.0.0.1

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.
{"cc_re__cc_re__cc_by_sa_3_0": ["        <li><a href=\"http://area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"http://careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2014.3.7.1431\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Server Fault works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </noscri"], "copyright__copyright__copyright": ["ove this question\nadd comment\n\n1 Answer\n\nkill -9 sends a SIGKILL which allows you to kill any process that isn't waiting on IO.\n\nA regular kill just sends SIGTERM which only asks the process to quit. Whereas SIGKILL tells the OS to immediately terminate the process.\n\nshare|improve this answer\nadd comment\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}