Re: Port of scoket usage (289 Views)
Reply
Advisor
porwaa
Posts: 26
Registered: ‎03-26-2009
Message 1 of 15 (289 Views)

Port of scoket usage

[ Edited ]

In my application running on HP-UX 11.11 PA RISC a listening socket is being used. I know lsof can be used to kill the socket. Unfortunately I'm not able to install lsof program.
When I do
swinstall -s lsof-4.82-hppa-11.11.depot

I'm getting an error as below

Could not contact host "lsof-4.82-hppa-11.11.depot". Make sure the │ │
│┌──│ hostname is correct and an absolute pathname is specified (beginning │─┐ │
││ │ with "/").



Then I do a
Source Depot Type: [ Local Directory
[ Source Host Name... ] lsof-4.82-hppa-11.11.depot
[ Source Depot Path /var/spool/sw.

It lookslike the Source Host Name is not correct but the field is not editable. Is it
that the host name entry should be in /var/adm/sw/defaults.hosts. I do not see defaults.hosts under that path. Please advice.
Also is there any way to detach the socket being used.

 

 

P.S. This thread has been moved from HP-UX > HP-UX Technical Documentation to HP-UX > patches - HP Forums Moderator

Please use plain text.
Honored Contributor
Suraj K Sankari
Posts: 1,659
Registered: ‎09-09-2008
Message 2 of 15 (289 Views)

Re: Port of scoket usage

Hi,

Please go through the below link and download the lsof and install

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

Suraj
Please use plain text.
Honored Contributor
Michal Kapalka (mikap)
Posts: 2,683
Registered: ‎08-19-2007
Message 3 of 15 (289 Views)

Re: Port of scoket usage

hi,

you dont have the absolute path to your depot

swinstall -s /absolute_path/sof-4.82-hppa-11.11.depo

- absolute path begins from /

mikap
Please use plain text.
Advisor
porwaa
Posts: 26
Registered: ‎03-26-2009
Message 4 of 15 (289 Views)

Re: Port of scoket usage

I gave the absolute path with below error-

# swinstall -s /tmp/lsof-4.82-hppa-11.11.depot /*

======= 05/15/09 05:25:22 EDT BEGIN swinstall SESSION
(non-interactive) (jobid=lrme025-0195)

* Session started for user "root@lrme025".

* Beginning Selection
* Target connection succeeded for "lrme025:/".
ERROR: There is currently no depot software on host "lrme025" at
location "/tmp/lsof-4.82-hppa-11.11.depot". Make sure that an
absolute pathname is specified for location (beginning with
"/").
* Source connection failed for
"lrme025:/tmp/lsof-4.82-hppa-11.11.depot".
WARNING: More information may be found in the daemon logfile on this
target (default location is lrme025:/var/adm/sw/swagentd.log).
* Selection had errors.



======= 05/15/09 05:25:23 EDT END swinstall SESSION (non-interactive)
(jobid=lrme025-0195)
Please use plain text.
Honored Contributor
Michal Kapalka (mikap)
Posts: 2,683
Registered: ‎08-19-2007
Message 5 of 15 (289 Views)

Re: Port of scoket usage

hi,

ps -ef |grep -i swagent

swinstall -i -s /depot

mikap
Please use plain text.
Honored Contributor
RAC_1
Posts: 5,920
Registered: ‎03-21-2002
Message 6 of 15 (289 Views)

Re: Port of scoket usage

You are doing many mistakes. Things to check.

1. hostname and ip resolution. is host anme resolving to correct ip and is ip resolving to correct host name?

2. restart swagentd.

3. swlist -d @ /xyz_path/xyz.depot

4. If all ok, then
swinstall -s /xyz_path/xyz.depot \*
(installs all from depot.)
There is no substitute to HARDWORK
Please use plain text.
Advisor
porwaa
Posts: 26
Registered: ‎03-26-2009
Message 7 of 15 (289 Views)

Re: Port of scoket usage

It got resolved. Where does losf is installed. On doing a find i saw it under /var/adm/sw/products/lsof but could not find the executable.
Please use plain text.
Honored Contributor
Michal Kapalka (mikap)
Posts: 2,683
Registered: ‎08-19-2007
Message 8 of 15 (289 Views)

Re: Port of scoket usage

hi,

check /otp directory or

use find / -name lsof

mikap
Please use plain text.
Advisor
porwaa
Posts: 26
Registered: ‎03-26-2009
Message 9 of 15 (289 Views)

Re: Port of scoket usage

Find command gives var/adm/sw/products/lsof
but executable binary is not there.
Please use plain text.
Honored Contributor
Michal Kapalka (mikap)
Posts: 2,683
Registered: ‎08-19-2007
Message 10 of 15 (289 Views)

Re: Port of scoket usage

hi,

/usr/local/bin/lsof

mikap
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,877
Registered: ‎03-06-2006
Message 11 of 15 (288 Views)

Re: Port of scoket usage

>On doing a find I saw it under /var/adm/sw/products/lsof but could not find the executable.

/var/adm/sw/ is the IPD, the registry where installed SD products are kept. (Don't fiddle with it.)

Your executable is elsewhere, most likely /usr/local/bin/lsof as mikap said.
You can also check this with:
swlist -l file -s /tmp/lsof-4.82-hppa-11.11.depot | grep /lsof
Please use plain text.
Honored Contributor
Patrick Wallek
Posts: 13,736
Registered: ‎06-21-2000
Message 12 of 15 (288 Views)

Re: Port of scoket usage

>>I know lsof can be used to kill the socket.

lsof can't kill anything directly. It just lists open files.

If you want to kill something, you will have to use lsof to determine the process id of the process to kill, then use the 'kill' command to kill it.
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,877
Registered: ‎03-06-2006
Message 13 of 15 (288 Views)

Re: Port of scoket usage

>Patrick: lsof can't kill anything directly.

fuser(1m) provides a -k option but it doesn't handle sockets.
Please use plain text.
Honored Contributor
Patrick Wallek
Posts: 13,736
Registered: ‎06-21-2000
Message 14 of 15 (288 Views)

Re: Port of scoket usage

>>fuser(1m) provides a -k option but it doesn't handle sockets.

And your point is?
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,877
Registered: ‎03-06-2006
Message 15 of 15 (288 Views)

Re: Port of scoket usage

>Patrick: And your point is?

Perhaps the differences between lsof and fuser led to porwaa's confusion.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation