Operating System - HP-UX
1831950 Members
3045 Online
110034 Solutions
New Discussion

swcopy : cannot contact host

 
SOLVED
Go to solution
MikeL_4
Super Advisor

swcopy : cannot contact host

I have a new server that I'm trying to run swcopy on some patches I just downloaded into a depot. When I run swcopy I receive:

Could not contact host "vspweb". Make sure the hostname is correct
and an absolute pathname is specified (beginning with "/").

uname -n returns correct name, and an nslookup resolves the host through /etc/hosts since the server isn't in DNS yet.

Any ideas ?? Thanks
8 REPLIES 8
steven Burgess_2
Honored Contributor

Re: swcopy : cannot contact host

Hello

Try a recycle of the agent

swagentd -r

and retry, post the results

HTH

Steve
take your time and think things through
Uday_S_Ankolekar
Honored Contributor

Re: swcopy : cannot contact host

Restarting the swagent probably will help

swagentd -r

-USA..
Good Luck..
MikeL_4
Super Advisor

Re: swcopy : cannot contact host

restarting swagent didn't help.

if I move resolv.conf out of the way swcopy works but since the servers are not in DNS yet
I don't see what difference this would make.
Sundar_7
Honored Contributor
Solution

Re: swcopy : cannot contact host

This is classic example of how name resolution works in HP-UX.

In HP-UX without nsswitch.conf , if you have /etc/resolv.conf file, ONLY DNS server is tried. If the entry is not found in DNS, /etc/hosts file WILL NOT BE TRIED.

nslookup will succeed, since it doesnt use gethostbyname() and gethostbyaddr() functions other HP-UX commands use.

Check if you have a /etc/nsswitch.conf file. I bet you dont :-)

Create a /etc/nsswitch.conf file with the following entry

hosts: dns [NOTFOUND=continue] files

restore your /etc/resolv.conf. It will work !
Learn What to do ,How to do and more importantly When to do ?
Jeff_Traigle
Honored Contributor

Re: swcopy : cannot contact host

Let me expand a bit on what Sundar said because his explanation isn't complete. Here's the more complete story from what I found in July to explain some problems we were having with some software. SD-UX binaries, judging from the behavior I've observed (which are the same as what you just experienced) are still 10.X binaries. (The following is a slightly modified version of what I sent in an email to explain the situation to my coworkers. If anything looks odd, it's probably because I didn't edit it enough to cut out internal stuff that wasn't really necessary for the explanation here. Of course, if you want to look in dns before files in your nsswitch.conf, you'll just reverse those entries in my concluding format for the file.)

In doing a lot of digging around through man pages and posts online regarding name resolution problems and binary compatibility between 10.20 and 11.00, here's what I've determined.

As a document a coworker found online mentioned rather cryptically, the problem arises because of the difference in the default way name resolutions occur between 10.X and 11.X. The critical part here is that in 10.X the default behavior is to return to the calling routine on any status other than UNAVAIL and on 11.X the default behavior is to continue on any status other than SUCCESS. The new logic is contained in the 11.X libc.2 library. The libc.1 library is still available for backwards compatibility with 10.X binaries linked to that library. Therefore, any binary compiled on a 10.X system that is run on an 11.X system is going to exhibit the name resolution behavior of the 10.X system because of the use of the old APIs in libc.1.

Our /etc/nsswitch.conf is set up as follows:

hosts: files dns

Since the default behavior under 11.00 is the intuitive one, this works fine for 11.00 binaries like nslookup, nsquery, ping, etc. However, the 10.X binaries interpret this file as follows:

hosts: files [SUCCESS=return NOTFOUND=return UNAVAIL=continue TRYAGAIN=return] dns

The only way to resolve this is to change the policy in /etc/nsswitch.conf to explicitly state the 11.00 default behavior as follows:

hosts: files [SUCCESS=return NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] dns
--
Jeff Traigle
Sundar_7
Honored Contributor

Re: swcopy : cannot contact host

Jeff,

Yes, you are right about the libc.1 thing. Even on 11.0, SD-UX binaries are linked to libc.1 and not to libc.2

But the whole discussion is valid ONLY when there is a nsswitch.conf with entries but defined for the exit STATUSes.

If there is no nsswitch.conf, the default name resolution policy used by 11.X is

dns [NOTFOUND=return TRYAGAIN=return] nis [NOTFOUND=return] files

Mike, you will be good to go if you have the following entry in /etc/nsswitch.conf file

hosts: dns [SUCCESS=return NOTFOUND=continue UNAVAIL=continue
TRYAGAIN=continue] files

- Sundar.
Learn What to do ,How to do and more importantly When to do ?
MikeL_4
Super Advisor

Re: swcopy : cannot contact host

Thanks for all the good infrmation.
Sundar_7
Honored Contributor

Re: swcopy : cannot contact host

Mike,

Since you havent closed the case yet, I just wanted to post some additional information that I found out. Could be useful to you or anyone that reaches this thread by searching the forum :-).

With 11.0, SD-UX binaries are linked to libc.1 and thus you would see them exhibit the name resolution behaviour of 10.X binaries.

With 11.11 and above, SD-UX binaries are linked to libc.2 and thus the name resolution behaviour of SD-UX binaries will be consistent with the other binaries that use the gethostbyname() and gethostbyaddr() system calls.

In 11.0 without the patch PHCO_28847, SD-UX binaries do not support NIS+.

Installing PHCO_28847 will link the SD-UX binaries to libc.2 that will make the name resolution behaviour of these binaries consistent.

- Sundar.
Learn What to do ,How to do and more importantly When to do ?