I am currently porting some legacy code into a new scheduling system. It runs on a number of source servers and invokes the following on a number of target servers. All servers are running Solaris 10.
The command at issue is:
The $? return value for this command is then tested for success before continuing the processing.
What seems to be happening, on some but not all server combinations, is that the remote script is executed and egrep succeeds (I changed the last /dev/null to /var/tmp/x to check), but the sshd process at the target end, and the ssh at source remain without terminating.
I understand that there is an issue with sshd not terminating until it receives EOF, but the suggested workaround (cf. is to re-direct output to /dev/null, which I think I'm already doing.
Am I missing something? Is there anything aside from the EOF not being received that might cause this behaviour?
The command at issue is:
Code:
ssh -o "BatchMode=yes" ${TARGET_USER}@${TARGET_HOST} "${TEST_SCRIPT} </dev/null 2>&1 | egrep ^${TEST_RESULT}$ >/dev/null 2>&1"
What seems to be happening, on some but not all server combinations, is that the remote script is executed and egrep succeeds (I changed the last /dev/null to /var/tmp/x to check), but the sshd process at the target end, and the ssh at source remain without terminating.
I understand that there is an issue with sshd not terminating until it receives EOF, but the suggested workaround (cf. is to re-direct output to /dev/null, which I think I'm already doing.
Am I missing something? Is there anything aside from the EOF not being received that might cause this behaviour?