Operating System - HP-UX
1753335 Members
5301 Online
108792 Solutions
New Discussion юеВ

remsh hang after first run

 
SOLVED
Go to solution
jerry1
Super Advisor

remsh hang after first run

We have a sun box that has moved out of our
network to another corp network.
When trying to do a remsh host1 -l user1 It runs on the first try then
hangs on the second to the HP server. Only
the HP servers have this problem. The suns
here still work with remsh over the WAN to
each other but from sun to hp it does not.
Anyone have this problem or know what is
causing it?
Nothing has changed except communication over
the WAN. Telnet, smtp, ftp work fine. But not
remsh. Looking for r-commands patches.

22 REPLIES 22
Ganesan R
Honored Contributor

Re: remsh hang after first run

Hi,

Make sure the port 514 is opened between the servers and switch/router/firewall's.

If you need other services like rexec, rlogin you should open these ports also.

Port 512/tcp : rexec (passwd reqd)
port 513/tcp : rlogin (passwd reqd)
port 514/tcp : remsh (no passwd reqd)

you can find more details on /etc/services. Confirm with your network people's.
Best wishes,

Ganesh.
jerry1
Super Advisor

Re: remsh hang after first run

Oh, this problem is evident with any server
here running 11.0 11i.


James R. Ferguson
Acclaimed Contributor
Solution

Re: remsh hang after first run

Hi:

You probably need to add the '-n' switch:

# remsh host -l user -n thecommand

See the manpages for more information.

Regards!

...JRF...
Jim Butler
Valued Contributor

Re: remsh hang after first run

hp to sun - use remsh
sun to hp - use rsh.

if its a permissions thing, you may need to look at either your netgroups file (check authentication, yp, etc). or simply /etc/hosts.equiv.

Since you mentioned network changes, if IP changes were in order, it sounds like it may be the netgroup thing. Names in netgroup need to match to the IP for the group to trust. (did any dns changes take place?).

good luck
Man The Bilge Pumps!
jerry1
Super Advisor

Re: remsh hang after first run

I tried using different switches in
inetd.conf for remshd. But they did not work. It does however work with the -n
on the command line like you said. Why??

Why does communicating over the WAN
affect remsh? This has been working okay
for over 10 years.
jerry1
Super Advisor

Re: remsh hang after first run

Jim, you need to read closer. This is not
a failure every time due to denial. Only on
the successive tries after the first until the first socket is finally closed.

James R. Ferguson
Acclaimed Contributor

Re: remsh hang after first run

Hi (again):

> It does however work with the -n
on the command line like you said. Why??

You haven't divulged what constitutes the . If you look at the manpages, as I suggested:

/* begin quote */

By default, remsh reads its standard input and sends it to the remote command because remsh has no way to determine whether the remote command requires input. The -n option redirects standard input to remsh from /dev/null. This is useful when running a shell script containing a remsh command, since otherwise remsh may use input not intended for it. The -n option is also useful when running remsh in the background from a job control shell, /usr/bin/csh or /usr/bin/ksh. Otherwise, remsh stops and waits for input from the terminal keyboard for the remote command.

*/ endof quote */

Regards!

...JRF...
jerry1
Super Advisor

Re: remsh hang after first run

James, it doesn't matter what the command is.

remsh host1 -l user1

or

rsh host1 -l user1


They all hang after the first successful
remsh or rsh.

truss output on the sun shows its waiting
for a response from the HP.
HP server is waiting for a response back
from the Sun. I can see the SYN_SENT in
netstat. It does timeout after about a
minute. Then you can run another remsh
successfully after that socket connection
is gone. If you try to run one after
that and there is still a TIME_WAIT on that
port. Then remsh hangs.

If there was a switch I could put into
the server to fix it. That would be great.
Now we have to look at putting -n into
the code running on a lot of sun boxes that
access the HP server for info.


Peter Nikitka
Honored Contributor

Re: remsh hang after first run

Hi Jerry,

- it matters, in which environment you call the command
- it doesn't matter if its SUN or HP - my Solaris10 acts identically.

This does NOT work without '-n', because the 'remsh/rsh' "eates" all input - you just see the first host. The option '-n' prevents rsh from opening stdin and the loop is executed as expected.

ef3nip00@ansbach[111] uname -a
SunOS ansbach 5.10 Generic_118833-36 sun4u sparc SUNW,A70

ef3nip00@ansbach[112] cat /tmp/fh
forth
ansbach
frankfurt
ef3nip00@ansbach[113] while read h
> do rsh $h 'uname -n; uptime'
> done forth
7:34pm up 21 day(s), 14:02, 0 users, load average: 0.25, 0.58, 0.55
ef3nip00@ansbach[114] while read h
> do rsh -n $h 'uname -n; uptime'
> done forth
7:35pm up 21 day(s), 14:03, 0 users, load average: 0.93, 0.73, 0.61
ansbach
7:35pm up 56 day(s), 13 hr(s), 1 user, load average: 0.55, 0.76, 0.59
frankfurt
7:35pm up 21 day(s), 14:02, 0 users, load average: 0.44, 0.47, 0.48

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"