Operating System - HP-UX
1825731 Members
2570 Online
109687 Solutions
New Discussion

script hangs up after changing IP address of other machine

 
Mak Chiu Chi
Occasional Contributor

script hangs up after changing IP address of other machine

Hi all,

I use 'rexec' in a script calling another script on a remote machine to change its IP address. After the IP address was changed, the script hangs up.

Any clue?
3 REPLIES 3
Mark Grant
Honored Contributor

Re: script hangs up after changing IP address of other machine

Well, it probably will. You have set up a tcp connection to an IP address that has suddenly changed and the original ip address is not available any more it will hang waiting for a response.

You could try running the remote script in the background with a nohup e.g

rexec host 'nohup
THe single quotes are important otherwise your rexec will happen in the background instead.
Never preceed any demonstration with anything more predictive than "watch this"
Steven E. Protter
Exalted Contributor

Re: script hangs up after changing IP address of other machine

You've got a connection to ip address 192.168.0.40 say in your arp table.

It disseppears because you've issued an ifconfig command and the ip address is 192.168.0.41


You've terminated the ip address you are connected to.

The script should hang.

You need to have your script run the ifconfig command in background:

nohup ifconfig &
sleep 20
#reconnect.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
KapilRaj
Honored Contributor

Re: script hangs up after changing IP address of other machine

What I would do is ......

Perform rexec using a diffrent interface on that node if you have multiple networks !

if u have only single interface better goto the console of the node and perform that !

regds,

Kaps
Nothing is impossible