Closing a socket of a running process while keeping the process alive

Solution Verified - Updated -

Issue

  • Closing a socket of a running process while keeping the process alive
  • Need syntax for ss -K|--kill command
  • We are trying to reload the TCP connection without restarting the service which doesn't have a reload command, so we are looking for the alternate command to kill the TCP connections
  • RHEL7 command ss -K throws error:
$ ss -K '( sport = :9001 )'
Netid  State  Recv-Q  Send-Q  Local Address:Port  Peer Address:Port
SOCK_DESTROY answers: Invalid argument

Environment

  • Red Hat Enterprise Linux 7 and later
  • Network socket like IPv4, IPv6, TCP, UDP, SCTP, etc

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content