Search code examples
bashgoogle-chromeunixpostmannetstat

Can still do POST and GET, although nothing running on server


On my server machine, I have an application that responds to port 9876.

I've closed the application with kill.

If I do netstat | grep 9876, no process is shown.

However, I can still do POST and GET request to the server machine (from both Postman and Chrome) on port 9876.

How is that possible?


Solution

  • Just netstat doesn't show you listening sockets/process

    Issue sudo netstat -lp | grep 9876, as Payalord mentioned, if you don't sudo you'll only list sockets controlled by your user. The last column will be PID/Program name which will help you find out who's keeping this socket open.

    man pages are your friends:

       -p, --program
           Show the PID and name of the program to which each socket belongs.
    
       -l, --listening
           Show only listening sockets.  (These are omitted by default.)
    

    As for avoiding the application from spawning a subprocess, you'll need to investigate this as there's not enough information here to know why it happens and how to avoid it.