Operating System - HP-UX
1752795 Members
5627 Online
108789 Solutions
New Discussion юеВ

Re: how to release a port in hpux

 
SOLVED
Go to solution
Sreer
Valued Contributor

how to release a port in hpux

Hi Gurus,

I have to close a port in my hpux box.

[root@caefr0p006 ~]# cat /etc/services | grep -i 7006
afs3-errors 7006/tcp # error interpretation service
afs3-errors 7006/udp # error interpretation service
[root@caefr0p006 ~]#
[root@caefr0p006 ~]#
[root@caefr0p006 ~]# netstat -an | grep -i 7006
tcp 0 0 0.0.0.0:7006 0.0.0.0:* LISTEN
tcp 0 0 44.47.100.106:7006 152.9.100.40:57767 TIME_WAIT
tcp 0 0 44.47.100.106:7006 152.9.100.40:57765 TIME_WAIT
tcp 0 0 44.47.100.106:7006 152.9.100.40:57764 TIME_WAIT
tcp 0 0 44.47.100.106:7006 152.9.100.40:57763 TIME_WAIT
tcp 0 0 44.47.100.106:7006 152.9.100.40:57762 TIME_WAIT
tcp 0 0 44.47.100.106:7006 152.9.100.40:57760 TIME_WAIT
tcp 0 0 44.47.100.106:7006 152.9.100.40:57759 TIME_WAIT
tcp 0 0 44.47.100.106:7006 152.9.100.40:57757 TIME_WAIT
tcp 0 0 44.47.100.106:7006 152.9.100.40:57756 TIME_WAIT
tcp 0 0 44.47.100.106:7006 152.9.100.40:57754 TIME_WAIT
tcp 0 0 44.47.100.106:7006 152.9.100.40:57751 TIME_WAIT
[root@caefr0p006 ~]#

My application team is asking to release the port 7006 .

Iam not worked much on the ports side.

Cpould you pls guide me how to close the port as listed above?

waiting for help
Rgds
Sree
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: how to release a port in hpux

Shalom,

Standard network configuration is for the network socket to close 60 seconds after even an abnormal termination of the process.

You might want to use lsof to figure out what application is using port 7006 and shut it down.

Shutting down the application is the way to go if you want that port released.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Solution

Re: how to release a port in hpux

Ports are closed when a process exits, so presumably there are processes on this system holding those ports open.

Well a quick google indicates that port 7006 is often used by BMC products such as Patrol or Control-M - if you have these on your system, you might want to stop/restart all the processes relating to that...

Also, do you know what the system with IP address 152.9.100.40 is and what it does? That might give you some clue as to what the processes holding the ports open are...

Otherwise you might want to get a copy of lsof:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.84/

then running:

lsof -i :7006

Should show you which processes have that port open

(I won't be surprised if the processe that have the port open are owned by the very application team that wants you to close them!)

HTH

Duncan


I am an HPE Employee
Accept or Kudo
rick jones
Honored Contributor

Re: how to release a port in hpux

Not much to add but this - if the application is written "correctly" the only thing standing in the way of it starting again and creating a listen endpoint on port 7006 is the existing LISTEN endpoint. The endpoints still in TIME_WAIT at the time you did the netstat -an are a don't care as far as application (re)start is concerned. Again though, that is if the application is written "correctly" which is to say sets SO_REUSEADDR before it attempts to bind() to the port number.
there is no rest for the wicked yet the virtuous have no pillows
Sreer
Valued Contributor

Re: how to release a port in hpux

Hi Gurus,
Thanks much for your help.

Your answers are excellent and is worked.

What I actioned is:

lsof -i:7006

identified PID

killed the PID

And the port got closed successfully.

Thanks again.

Rgds
Sree