Sample Header Ad - 728x90

executing script on remote host using ssh does not return

0 votes
2 answers
2585 views
We have several scripts on remotehost which we trigger from my localhost using ssh like below. ssh remuser@remhost sh /web/bin/stop.sh We had OS patching activity this weekend post which the above ssh command never returns and feels like it is hung or waiting for input. It may be difficult to get details regarding what patch was applied to the OS. Here are the details of the stop.sh cat stop.sh exec /usr/bin/java -jar /web/service.jar -DLOG_PATH=/web/logs --server.address=10.23.41.211 --server.port=10500 --spring.profiles.active=dev >> /web/logs/boot.log exit 0; First, we tried this solution from this forum but it does not return. ssh remuser@remhost 'sh /web/bin/stop.sh my.jar dev &> /dev/null closed We then tried the below and the ssh started returning but was unable to run the script on the remote host. ssh -fN remuser@remhost sh /web/bin/stop.sh my.jar dev Note: ssh remuser@remhost id does return and works fine. Other scripts also work fine. The issue is only with the scripts that have or >> where the control returns back to the invoker host. Can you please suggest? Note: There is no reason to debug the scripts. They are not the cause of issue as all the script are different and some very simple.
Asked by Ashar (527 rep)
Apr 20, 2021, 06:18 PM
Last activity: May 8, 2024, 09:45 AM