Problem

A port is being used by some process but the pid of process is not visible

Reason

When the process is started by root, other users not in the root group cannot view the process ids. So when you do:

netstat -atnp

process id will not be visible to normal user.

You have to run netstat command with sudo, to view all process ids.

1
sudo netstat -atnp

A scenario I came across is when Apache tomcat was started as a Java service with jsvc command. The daemon.sh was run by the root user, so the process belonged to root.

it is used by root jsvc.exec usses 8080 centos security cannot see pid of process run by root