risby
Programmer
- Feb 27, 2002
- 84
Peeps
I have a Korn shell script that runs on an HP-UX machine. It loops over a set of machines using remsh to log on to each machine, as a specified user, and then runs a sequence of commands/scripts.
Unfortunately it only executes the first sequence (it only visits the first machine): I can see that it successfully executes everything from the final script in the sequence but then it just hangs. In the original script the next thing to execute is a test on the remsh return status followed by one print or another saying whether it successfully connected.
(I know this is just whether the remsh connection is successful, not the status of the last command executed remotely; the point is the original script should write out something when remsh finishes but nothing more is printed so remsh has not finished.)
I have used the -n option on the remsh command because the man page says it can sometimes get its local and remote stdin confused (or summat like that). It made no difference whether I used the -n option or not.
I have used an "exit 0" at the end of the command sequence executing remotely and tried a "return 0" neither of which should make a blind bit of difference but I'm at the grasping at straws stage. I also added an "exit 0" at the end of the final script executed remotely. None of these ploys made a blind bit of difference.
I have successfully executed that sequence of commands/scripts in a loop having already interactively remsh'd to one particular machine (that is it loops over the sequence several times but only on one machine, there is no remsh). This last experiment proves, I think, that it is some interaction between remsh and the remote sequence (or final script). The final script is not sufficient to cause the hang.
I have also started the original looping script from a Linux machine and used rsh instead of remsh and it still hangs.
Does anybody have similar experience to relate or, better, a solution to this phenomenon?
Thanks in advance
Ris
==========================================
I phoned the local ramblers club today, and this bloke just went on and on.
I have a Korn shell script that runs on an HP-UX machine. It loops over a set of machines using remsh to log on to each machine, as a specified user, and then runs a sequence of commands/scripts.
Unfortunately it only executes the first sequence (it only visits the first machine): I can see that it successfully executes everything from the final script in the sequence but then it just hangs. In the original script the next thing to execute is a test on the remsh return status followed by one print or another saying whether it successfully connected.
(I know this is just whether the remsh connection is successful, not the status of the last command executed remotely; the point is the original script should write out something when remsh finishes but nothing more is printed so remsh has not finished.)
I have used the -n option on the remsh command because the man page says it can sometimes get its local and remote stdin confused (or summat like that). It made no difference whether I used the -n option or not.
I have used an "exit 0" at the end of the command sequence executing remotely and tried a "return 0" neither of which should make a blind bit of difference but I'm at the grasping at straws stage. I also added an "exit 0" at the end of the final script executed remotely. None of these ploys made a blind bit of difference.
I have successfully executed that sequence of commands/scripts in a loop having already interactively remsh'd to one particular machine (that is it loops over the sequence several times but only on one machine, there is no remsh). This last experiment proves, I think, that it is some interaction between remsh and the remote sequence (or final script). The final script is not sufficient to cause the hang.
I have also started the original looping script from a Linux machine and used rsh instead of remsh and it still hangs.
Does anybody have similar experience to relate or, better, a solution to this phenomenon?
Thanks in advance
Ris
==========================================