web-dev-qa-db-ja.com

Perlスクリプトをリモートホストに送信するときにTrampがハングするのはなぜですか?

これが直接プログラミングに関連していないことは知っていますが、私は困惑しています。Emacsが私のメインのプログラミングツールなので...

テストホストに接続するようにTrampを設定しようとしています。 /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スクリプトを送信しようとすることです。私が別のシェルでそれを殺しているので、プロセスは死にかけています。さもなければ、emacsはこれから戻ってきません。

Carbon Emacs22.3.1ビルドでTrampFreeBSD 6.2-RELEASE-p5を使用して、OSX10.5.7から2.0.58-preに接続しています。

1
Chris R

おそらく、受信側(FreeBSDサーバー)のsshdのpidのstraceは、どこでロックされているかを示します。 -fを使用して子プロセスに従う必要があります。 sshdのpidが3125の場合:

Sudo strace -vfp 3125 -o sshdStraceDump.txt
1
Kyle Brandt