Greetings
I need to close stdin,stdout,stderr for a child process of sshd (fairly well known issue, but never seem to find a solution)
What happens is a script ssh's to another server and runs a start script for various in-hosue software. The ssh session hangs because it never receives back the close for the file descriptor since the child proc inherits the shell's.
I can narrow down the PID of the parent sshd and see the open fd0,1,2:
lsof -a -p `ps -ef|grep "\[priv\]" | grep -v grep | awk '{print $2}'` -d0,1,2
But I am unsure as to how to close the fd's for this single process ... I am not sure if I can just pipe or echo the pid to <>&- and 0>&- or if I need to reassing the fd's inside the script, then close them inside the script at the end, etc ...
Any ideas is greatly appreciated.