digiturf.net

Freeing TCP Port which do not have PID / iNode Number.


QUESTION :  Could you please take a look on the server c000pcp. Looks like port 10901 is stuck with BigIP and not releasing it. “Middleware” application runs on that PORT generally.

$ netstat | grep 10901
tcp        1    200186    c000pcp:10901    bigipecomextb:55491    LAST_ACK

ANSWER :  Generally to FREE the TCP / UDP Port we will first, find the process name / PID number which is holding it by executing below commands and then kill the process which will free that particular PORT.

c000pcp:~ # netstat –programs | more
Active Internet connections (w/o servers)
Proto Recv-Q        Send-Q        Local Address               Foreign Address                        State              PID/Program name
tcp        0          0              c000pcp:ssh           U0117627-W7:56295                ESTABLISHED          3745/sshd
tcp        0          0              c000pcp:ssh           U0117627-W7:61993                ESTABLISHED          689/sshd
tcp        0          0              c000pcp:elcsd        prod-ecom-h0192:nfs                 ESTABLISHED                –
tcp        0          0              c000pcp:51876       c943frs:9354                             ESTABLISHED          30415/java
tcp        0          0              c000pcp:9354         c800ueq:37691                         ESTABLISHED          27702/java
tcp        0          0              c000pcp:9354         c943frs:49104                            ESTABLISHED          27702/java
tcp        0          0              c000pcp:55646       c852dpq:9352                           ESTABLISHED          30415/java
tcp        0          0              c000pcp:37526       c000pcp:9354                            ESTABLISHED          30415/java
tcp        0          0              c000pcp:iua            c000pcp:39437                          ESTABLISHED          27702/java
tcp        1    200186          c000pcp:10901       bigipecomextb:55491                 LAST_ACK                  –

 # netstat –program –numeric-hosts –numeric-ports –extend |grep — ‘-‘ | head -10
Proto Recv-Q Send-Q Local Address               Foreign Address             State       User       Inode      PID/Program name
tcp        0      0 10.216.31.60:866            10.215.126.165:2049         ESTABLISHED root       72902005   –
tcp        0      0 10.216.31.60:1055           167.68.248.95:48395         TIME_WAIT   root       0          –
tcp        0      0 10.216.31.60:704            10.216.126.252:2049         ESTABLISHED root       72901997   –
tcp        0      0 10.216.31.60:948            10.214.123.3:2049           ESTABLISHED root       72903931   –
tcp        0      0 10.216.31.60:1055           167.68.248.95:42057         TIME_WAIT   root       0          –
tcp        0      0 10.216.31.60:701            10.216.126.251:2049         ESTABLISHED root       72902001   –
tcp        1 200186 ::ffff:10.216.31.60:10901   ::ffff:167.68.224.207:55491 LAST_ACK    root       0          –
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  3      [ ]         STREAM     CONNECTED     10826  1595/hald-addon-acp

$ find -inum 72902001

         Which will show you a file which might lead you to a process. Here PORT we are looking for is showing Inode number as 0, hence we did not get any clue to FREE the port.

*    HENCE, THERE IS NO WAY OF FREEING THIS PORT, WE NEED TO REBOOT THE SERVER.
* *  If anyone of you know, other solution than reboot, let me know and i will update the post. thanks for visiting.

.

Leave a Reply