
これは直接プログラミングに関係するものではないことはわかっていますが、困惑しています。Emacs が私の主なプログラミング ツールなので...
テストホストに接続するように Tramp を設定しようとしています。 または を使用して呼び出しています/ssh:host:.bashrc
が、/scp:host:.bashrc
遅かれ早かれ、どちらも同じ問題に遭遇します。
プロセスが停止し、クライアントからの SSH セッションを強制終了する前に、Perl スクリプトを送信する最初の試行までしか進みません。
例えば:
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 がここから復帰することはありません。
FreeBSD 6.2-RELEASE-p5
私はOSX 10.5.7 から接続していますが、何か違いがあるかどうかはわかりませんが、 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