Как узнать, какая служба использует порт?
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
# netstat -natpv | grep 9090
tcp6 0 0 :::9090 :::* LISTEN 1/systemd
#
Пожалуйста, порекомендуйте.
# systemctl status cockpit.service
● cockpit.service - Cockpit Web Service
Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static; vendor preset: disabled)
Active: inactive (dead) since Mon 2019-06-10 12:43:51 EDT; 4 days ago
Docs: man:cockpit-ws(8)
Main PID: 15922 (code=exited, status=0/SUCCESS)
Jun 10 12:41:48 X.X.X systemd[1]: Starting Cockpit Web Service...
Jun 10 12:41:48 X.X.X systemd[1]: Started Cockpit Web Service.
Jun 10 12:41:48 X.X.X cockpit-ws[15922]: Using certificate: /etc/cockpit/ws-certs.d/0-self-signed.cert
Jun 10 12:42:05 X.X.X cockpit-session[16311]: pam_ssh_add: Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa)
Jun 10 12:42:07 X.X.X cockpit-ws[15922]: logged in user session
Jun 10 12:42:07 X.X.X cockpit-ws[15922]: New connection to session from 10.52.208.221
Jun 10 12:42:21 X.X.X cockpit-ws[15922]: WebSocket from 10.52.208.221 for session closed
Jun 10 12:42:36 X.X.X cockpit-ws[15922]: session timed out
# lsof -i :9090
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd 1 root 75u IPv6 7761202 0t0 TCP *:websm (LISTEN)
#
не идеально, но лучше тогда ничего:
# systemctl | grep listening
dm-event.socket loaded active listening Device-mapper event daemon FIFOs
iscsid.socket loaded active listening Open-iSCSI iscsid Socket
iscsiuio.socket loaded active listening Open-iSCSI iscsiuio Socket
lvm2-lvmpolld.socket loaded active listening LVM2 poll daemon socket
systemd-initctl.socket loaded active listening /dev/initctl Compatibility Named Pipe
systemd-shutdownd.socket loaded active listening Delayed Shutdown Socket
virtlockd.socket loaded active listening Virtual machine lock manager socket
virtlogd.socket loaded active listening Virtual machine log manager socket
#
в моем случае это было cockpit.socket
(не cockpit.service
)
systemctl list-sockets
должно отображать точное название объекта и соответствующую услугу.
LISTEN UNIT ACTIVATES
[::]:9090 cockpit.socket cockpit@0.service