rmsock Command

Purpose

Removes a socket that does not have a file descriptor.

Syntax

rmsock Address TypeofAddress

Description

The rmsock command removes a socket that does not have a file descriptor. It accepts a socket, tcpcb, inpcb, ripcb, or rawcb address and converts it to a socket address. All opened files in every process are then checked to find a match to the socket. If a match is not found, an abort action is performed on that socket regardless of the existence of the socket linger option. The port number held by the socket is released. If a match is found, its file descriptor and status of the owner process are displayed to the user. The results are passed to syslogd and recorded in the /var/adm/ras/rmsock.log file.

If the socket to be removed is not held by any active processes, but there are processes in the exiting state, rmsock will not remove the socket specified because the socket could be held by the processes in the exiting state. Any socket that is held by the exiting processes will be cleaned up when those processes exit completely.

Examples

  1. To remove a socket from its socket address, type:
    rmsock 70054edc socket

    You do not need to specify the type of the socket. It can be a tcpcb, udp, raw, or routing socket.

  2. To remove a socket from its inpcb address, type:
    rmsock 70054edc inpcb
  3. To remove a socket from its tcpcb address, type:
    rmsock 70054ecc tcpcb

Files

Item Description
/usr/sbin Directory where the rmsock command resides.
/var/adm/ras/rmsock.log Contains the rmsock.log file.