為什麼 TRAMP 在將 Perl 腳本傳送到遠端主機時掛起?

為什麼 TRAMP 在將 Perl 腳本傳送到遠端主機時掛起?

我知道這與程式設計沒有直接關係,但我很困惑,因為 Emacs 是我的主要程式設計工具...

我正在嘗試設定 Tramp 以連接到我的測試主機。我使用 or 呼叫它,/ssh:host:.bashrc但這/scp:host:.bashrc兩者遲早都會遇到同樣的問題。

他們只在進程楔入之前第一次嘗試發送 perl 腳本,我被迫從客戶端終止 ssh 會話。

例如:

tramp: Opening connection for username@host using scp...
tramp: Waiting 60s for local shell to come up...
tramp: Sending command `ssh host -l username  -e none || exit'
tramp: Waiting for prompts from remote shell
tramp: Waiting 60s for prompt from remote shell on host host
tramp: Found remote shell prompt on `host'
tramp: Waiting 30s for remote `/bin/sh' to come up...
tramp: Setting up remote shell environment
tramp: Determining coding system
tramp: Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE'
tramp: Waiting 30s for `set +o vi +o emacs'
tramp: Waiting 30s for `unset MAIL MAILCHECK MAILPATH'
tramp: Waiting 30s for `unset CDPATH'
tramp: Setting shell prompt
tramp: Remote `/bin/sh' groks tilde expansion, good
tramp: Finding command to check if file exists
tramp: Finding a suitable `ls' command
tramp: Checking remote `/bin/ls' command for `-n' option
tramp: Testing remote command `/bin/ls' for -n...okay
tramp: Using remote command `/bin/ls' for getting directory listings
tramp: Sending the Perl script `tramp_file_attributes'...
tramp-wait-for-output: Process has died

此追蹤正在使用該scp方法。方法ssh如下所示:

tramp: Opening connection for username@host using ssh...
tramp: Waiting 60s for local shell to come up...
tramp: Sending command `ssh host -l username  -e none || exit'
tramp: Waiting for prompts from remote shell
tramp: Waiting 60s for prompt from remote shell on host host
tramp: Found remote shell prompt on `host'
tramp: Waiting 30s for remote `/bin/sh' to come up...
tramp: Setting up remote shell environment
tramp: Determining coding system
tramp: Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE'
tramp: Waiting 30s for `set +o vi +o emacs'
tramp: Waiting 30s for `unset MAIL MAILCHECK MAILPATH'
tramp: Waiting 30s for `unset CDPATH'
tramp: Setting shell prompt
tramp: Remote `/bin/sh' groks tilde expansion, good
tramp: Finding command to check if file exists
tramp: Finding a suitable `ls' command
tramp: Checking remote `/bin/ls' command for `-n' option
tramp: Testing remote command `/bin/ls' for -n...okay
tramp: Using remote command `/bin/ls' for getting directory listings
tramp: Sending the Perl `mime-encode' implementations.
tramp-wait-for-output: Process has died

正如您所看到的,最後發生的事情是嘗試發送 Perl 腳本。該進程正在死亡,因為我正在另一個 shell 中殺死它,否則 emacs 永遠不會從中恢復。

我正在從 OSX 10.5.7 連接到FreeBSD 6.2-RELEASE-p5,如果有什麼區別的話,2.0.58-pre在 Carbon Emacs 22.3.1 版本中使用 Tramp。

答案1

也許接收端(FreeBSD 伺服器)上 sshd 的 pid 上的 strace 會顯示它在哪裡鎖定。您將需要使用 -f 來追蹤子進程。如果sshd的pid是3125:

sudo strace -vfp 3125 -o sshdStraceDump.txt

相關內容