Operating System - HP-UX
1834660 Members
2388 Online
110069 Solutions
New Discussion

Re: remsh process not exiting

 
Rick Garland
Honored Contributor

remsh process not exiting

Hi all:

Got two systems, 10.20 & 11.00. The 10.20 system functions as a backup master. Got a dump script that does the backups for these two systems. The 10.20 system does a remsh to the 11.00 system to execute a dump script. The backup completes and is fine but the remsh process does not exit, need to kill the processes the next day. I believe a patch is required but have searched and read the patch text files and do not really see anything that describes this situation. Is there a patch to solve this or is something else going on. From 10.20 to 10.20 the remsh process exits when the backup is complete.

Many thanks to all!
Rick
6 REPLIES 6
Rumen Ginev
Frequent Advisor

Re: remsh process not exiting

I tried to do something similar, from the command prompt. I have no problems with remsh from 10.20 to 11.00.
Why don't you send the script you have used or the just the line that does "remsh".

Regards, Roumen

Rick Garland
Honored Contributor

Re: remsh process not exiting

The remsh process being executed is
remsh $SYSTEM rbstart

The rbstart is a backup script that is common on all systems. Variables such as hostname, date, FSTYP, dump level, oracle shutdown, etc., are being passed into the script. Mix of hfs and vxfs FSTYPs.
Again, the FSTYPs are a mix across all systems, but this issue only seems to be 10.20 to 11.00. The 10.20 to 10.20 doesn't have a problem.
Paul Hite
Trusted Contributor

Re: remsh process not exiting

Here's a wild guess...
Try:
remsh -n $SYSTEM rbstart
Alan Riggs
Honored Contributor

Re: remsh process not exiting

I have run into a similar situation running certain application scripts through a remsh from one 10.20 sytem to another. Even adding explicit exit statements to the remote script would not return control to the "master" script. The -n option (which tells remsh not to read from stdin) did not help me. I never was able to track down exactly what in the application script caused the issue. In the end, I used a a workaround:

Place the remsh call in the background.
Either set a time limit within which you know the job will complete, or set a semaphore file in the remote script.
Sleep until exit condition (time or semaphore) is reached.
Kill the pid of the last job run in the background. [$!] (Note: if you have several remsh processes that you wish to run in parallel, it is necessary to capture each PID separately and store them in environmental variales.)

A simple example:

remsh -n remote_box remote_script &
sleep 300
kill "$!"
Michael Marburger
New Member

Re: remsh process not exiting

Rick... SWAG -
remsh $host -l username . backuproutine

and in backuproutine put "exit" as last statement. Consider, also what shell you are using. Is it a restricted shell on the remote host? Probably not - probably root's shell.
John Palmer
Honored Contributor

Re: remsh process not exiting

Does the backup script kick off any processes when it finishes i.e. restarting a database or application? If so then those processes may be inheriting the standard input provided by the remsh process. Try amending the call to start the database (or whatever) to include < /dev/null. Or you could put exec 0< /dev/null at the start of the backup script.