- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to release a locked port
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2002 12:27 AM
09-16-2002 12:27 AM
How to release a locked port
I executed the following command:
netstat -a |grep 1225
I got the following output:
tcp 0 0 *.1225 *.* LISTEN
I also grep'ed for the port using the following
command:
ps -ef |grep 1225
I didn't get any output. Wondering if there
is any other way of release this port.
Thanks very much in advance,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2002 12:32 AM
09-16-2002 12:32 AM
Re: How to release a locked port
use it only as a last resort.
To use the ndd -set /dev/tcp tcp_discon, you need the pointer to the TCP instance data. You can retrieve this via the ndd command tcp_status.
So, the scenario to find the TCP instance data and then use tcp_discon to remove the instance is as follows:
# ndd -get /dev/tcp tcp_status
TCP dest snxt suna swnd cwnd rnxt rack rwnd rto mss [lport,fport] state
0183b8b4 015.043.233.086 533cb8ce 533cb8ce 00008000 00003000 533bc583 533bc583
00000000 02812 04096 [c00a,cea9] TCP_CLOSE_WAIT
So, if you wanted to remove this connection:
# ndd -set /dev/tcp tcp_discon 0x0183b8b4
If you want to use the tcp_discon_by_addr, you use a 24 byte string that contains the hex
representation of the quadruple.
For example, if the connection that I want to delete is:
Local IP: 192.1.2.3 (0xc0010203)
Local Port: 1024 (0x0400)
Remote IP : 192.4.5.6 (0xc0040506)
Remote Port: 2049 (0x0801)
The "hex" string you pass to tcp_discon_by_addr is:
# ndd -set /dev/tcp tcp_discon_by_addr "c00102030400c00405060801"
NOTE: the preceding 0x that typically indicates a Hex number is NOT part of the
string passed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2002 10:52 AM
09-27-2002 10:52 AM
Re: How to release a locked port
to find the process or processes with references to the given port number you should download th elsof tool from the net - perhaps the hpux.connect.org.uk archive and run that. then you can terminate that process to free-up the port.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2002 11:01 AM
09-27-2002 11:01 AM
Re: How to release a locked port
You can use tcp_discon or tcp_discon_by_addr as suggested by Stephan but is not recommended.
Also, lsof from our hp distribution center is only for 32bit and if you have 11.0 64bit OS, it won't help you. You will need to recompile.
Best place to get lsof for 64bit is the following site
ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/binaries/hpux/B.11.00/vxfs/64/9000_800/
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2002 11:48 AM
09-27-2002 11:48 AM
Re: How to release a locked port
If you haven't used this port in /etc/services and want to free up this port.
Do this.
lsof -i servername:portnumber
This will give you the process id's
You kill the process running on this port number.
By the way, "lsof" is available as a freeware, and you may get it on hp-ux porting website. Also, it is easy to install as it's available as a .depot file.
Regards,
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2002 02:10 PM
09-27-2002 02:10 PM
Re: How to release a locked port
You would need to download the lsof utlilty from this site :
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/
then you can run lsof | grep 1225 this will shown as a port for a process which can be killed to realease the por t, howver the other ports wiht the process will aslo ge tkilled , also you have 32 /64 bit binaries for the bothe the flacours of HPUX so that it can be easliy configured. Incase you cannot do that please send me your email id and I will send you the comipled version of losf
Manoj Srivastava