0

I have a script which gets hanged while doing SSH from a Daemon , whereas it works perfectly while I run it from the terminal.

  • Source Machine - redhat-rhel7.3-EUS-x86_64
  • Remote Machine - Solaris 11.4
ssh XXXXXX << EOF
echo "Start executing script" >>/app/temp.log
/app/script.ksh 1 2 >> /app/temp.log
echo "finish executing script" >>/app/temp.log
exit 0
EOF

echo "Final execution completed">>/app/temp.log

  1. RUN 1 - From terminal (User X) , the script get completed and there will be no process running
  2. RUN 2 - From Daemon(Running on User X) , the script stuck at EOF I believe , as I can see log file has "finish executing script" , and I can see process running

What should I do to make script work?

PS - script.ksh exists in the remote server

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
Gaurav Soni
  • 101
  • 1
  • Can you ssh to the remote server when the script is hanging? You should be able to see your ssh session in the output of `ps`. See if there are any child processes it's waiting on. – Andrew Henle Mar 21 '21 at 16:12
  • @AndrewHenle The script gets completed , I can see the last echo in the log file – Gaurav Soni Apr 01 '21 at 12:11

0 Answers0