-   Linux - Newbie (
-   -   SSH script hangs on exit on solaris but linux works (

say_hi_ravi 09-02-2012 02:17 AM

SSH script hangs on exit on solaris but linux works

I am doing below steps:
1. Copying one script to remote server using SSH.
2. executing that script using SSH.

Below is the command:


#scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=10 /home/ravmane/sysmgmt/sentinel_scripts/ testserver1:/tmp/;ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=10 testserver1 "/tmp/"
On Linux server the script executes and exit from the remote server properly.

But on Solaris it executes the script but does not exit. We have to make it manually exit using ^C.

I want to run it on many Solaris servers.

The script last lines are below:


/etc/init.d/service-rem start

sleep 5

ps -edf | grep rem
Any help/hint would be much appreciated.


TB0ne 09-02-2012 10:11 AM

Well, unless you show us the script, we're not going to be able to tell you ANYTHING about why it's failing. The lines you've provided can't tell us anything outside of the context of the rest of the script.

say_hi_ravi 09-03-2012 10:00 PM


Below is the script.



sed 's/su mdscout/su root/g' /etc/init.d/solscout > /tmp/ && mv /tmp/ /etc/init.d/solscout

chmod +x /etc/init.d/solscout

/etc/init.d/solscout stop

sleep 5

RESULT=`pgrep solscout`

if [ -z "$RESULT" ]; then
echo "Scout not running"
echo "Scout running, attempting to kill"
pkill -KILL solscout

/etc/init.d/solscout start

sleep 5

ps -edf | grep scout

TB0ne 09-04-2012 01:20 PM


Originally Posted by say_hi_ravi (Post 4771974)
Below is the script.

No, it isn't. The lines you provided in your first post don't match anything in the script of the second. Best way to diagnose it is to run each command in the script, line by line, from a terminal window. See what the commands do. Also, you say it's not exiting...but you don't have an exit in there anywhere.

All times are GMT -5. The time now is 04:13 PM.