Thanks to the numerous people who replied to my question about rsh
hanging when performing a reboot of a remote node. Here is the
> Wonders never cease to amaze me ....
> We are using rsh from within a script to rsh to a remote machine and
> reboot it. The command looks like this:
> rsh -n -l root sdib01 reboot
> When this is performed, the machine sdib01 does indeed reboot, but the
> rsh never exits. It just sits there. This problem also exists for us
> if we execute it from the command line. This leads to a bigger problem
> we have where the shell that executes this command is part of a admin
> procedure and the shell hangs gobbeling up CPU (bumps the load average
> up to 3.9-4.1, when it normally hangs out about .2!!) To top it off,
> once this occurs telnetting into the machine gives you the interactive
> menu of the shell process left running rather than the password:
> prompt (nice, eh?)
> We've called Sun about the telnet problem and it's a bug in telnetd.
> Cool there. However, we have no answer as to why our rshell hangs.
> Thanks all!
Just about every one of the replies said to place the reboot command
in the background, as well as redirecting stdin, stdout and stderr on the
remote machine with a commond like:
rsh -n -l root sdib01 "reboot > /dev/null 2>&1 < /dev/null &"
The reasons for this are two fold: 1) rsh does not exit until its socket
is properly closed. Previously, reboot would bring the node down, the
socket would never be properly closed, so rsh would wait forever. By
redirecting stdin, stdout and stderr, you are forcing the socket closed
because there is no data to be transferred. By placing the reboot command
in the background, you are guarenteing that the rsh will exit as the
foreground process returns.
Some other ideas were to use shutdown with some small time value. This
would cause shutdown to fork a program to do the actual shutdown in the
background, while the foreground copy exists, returning the rsh.
Once again, thanks to all for replying! Please forgive me for not
including a list of the people who responded ... my mail is being run
from a PC under DOS (no mail at work :-( and I do not have methods for
extracting headers from mail in a nice fashion (short of writing down
each and every address!)
Kevin W. Hammond
-- -kwh- email@example.com
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:21 CDT