2015-12-29 30 views
0

我一直在嘗試使用ssh通過網絡觸發一些安裝腳本。最初這些腳本使用的是git clone,但我一直收到錯誤代碼141(根據git mailing list,似乎是SIGPIPE)。試圖用wget來代替混帳顯示了相同的問題,即:爲什麼ssh + nohup不能與網絡相關的進程一起工作?

ssh [email protected] 'nohup wget http://google.ch &' // produce no result on the server 
ssh [email protected] // then on the server 
nohup wget http://google.ch & // works 

與不同的服務器(於Debian/Ubuntu/VM /本地)已經嘗試過。儘管這樣使用apt。 任何想法的原因和建議的解決方案?提前致謝。

+0

幾個在這裏的反應可以幫助你。 http://stackoverflow.com/questions/5185717/bash-spawn-subshel​​l-for-ssh-and-continue-with-program-flow/5199505#5199505 ..祝你好運。 – shellter

+0

做到了,謝謝! – Zifeo

回答

0

對於那些在類似情況下,@shellter的指針是一個很好的閱讀(謝謝!)。一個解決方案是使用-t -t用ssh旗幟和小心,不要在命令中包括後臺切換,即:

ssh -t -t [email protected] 'nohup command' > /dev/null 2>&1 & 
相關問題