命令输出,iwconfig

命令输出,iwconfig

我有一个 xubuntu 盒子,使用它的终端本地一切都很好;但是当我 ssh 到任何服务器时,远程 echo 似乎保留了最后一行直到按下某个键或者窗口大小被调整。在长输出命令中,只输出前几行(即寻找请参阅下面的测试)。该问题不在本地出现,但会影响所有依赖 ssh 的实用程序,即 git、scp。即使进程正在运行并显示输出(除非反复按下键,否则不会更新),ssh 会话也会随机关闭。

终端挂起,直到按下某个键才会显示下一个提示

在截屏视频中http://www.tmg.it/files/funnyterm.ogv,所有命令都以回车结束;我在命令之间等待 5 秒钟。如您所见,只有当我再次开始输入时,才会显示带有提示符的行。

我进行的测试:

  • 从 USB 驱动器上的实时 Ubuntu 13.04 启动显示同样的问题!
  • 从 USB 驱动器上的实时 Ubuntu 12.04 启动很好用
  • 从 USB 驱动器上的实时 xubuntu 13.04 启动显示同样的问题!
  • 无论是使用 WiFi 还是 LAN 连接都会出现同样的问题
  • 在窗口中,如果我调整其大小,输出将会更新
  • 按右箭头或任何其他非字符键也会更新
  • 使用 CTRL-ALT-F1 打开的全屏控制台中也会出现同样的问题
  • 使用另一个终端,即 aterm,无法解决问题
  • 本地和远程删除 .bashrc 和 .bash_profile 并不能解决问题。
  • 该问题出现在几个远程 CentOS 32 位和 64 位 v5.8、5.9 和 6;远程 Ubuntu 10.04.4 LTS 上。

scp 测试:- 如果文件 < MTU,则 scp remotefile localfile 有效。- 尝试摆弄 MTU,将其设置为 1000 至 1600 之间的几个值 - 没有成功。

查找测试:在 ssh 连接中,在包含许多文件的文件夹中查找将在输出几行后停止。按 3-4 次 Return 键将显示接下来的几行。我开始从 iwconfig 监视 Tx 过度重试和无效杂项,并看到“无效杂项”和“过度重试”每返回几次就会增加:

系统是最新的 xubuntu 13.04 amd64,带有 lamp 堆栈,运行在 Samsung RC530-S05IT(i7/6Gb ram/60Gb HDD 分区 + 一个额外的 SSD 驱动器)上。我第一次注意到这个问题是在只安装了 lamp + eclipse 时,并且可以从实时发行版(相同版本)启动时重现它。

网络中的其他系统不会出现此问题(更新!mac 也开始出现此问题!)。在这台电脑上,CentOS 在虚拟机中运行良好,Windows 7 和 Putty 以及 cygwin 也运行良好,此外还有来自 usb/iso 的任何非 13.04 (x)ubuntu 发行版。13.04 (x)ubuntu 甚至无法从实时 usb 启动。

命令输出,iwconfig

$ echo“#在 ssh 连接中查找”;date +“%H:%M:%S”;iwconfig 2> nul | grep misc

#find in ssh connection
14:22:56
          Tx excessive retries:695  Invalid misc:273   Missed beacon:0

#find in ssh connection.. after a few returns were pressed in the terminal:
14:23:07
          Tx excessive retries:697  Invalid misc:281   Missed beacon:0

$系统配置

eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"zzz-guests"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: A4:B1:E9:97:72:ED   
          Bit Rate=65 Mb/s   Tx-Power=15 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=62/70  Signal level=-48 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:582  Invalid misc:209   Missed beacon:0

以下块是在完成巨大的 find 命令后,ubuntu 12.04 上 ssh 工作正常的 iwconfig 的输出:

wlan0     IEEE 802.11bgn  ESSID:"zzz-guests"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: A4:B1:E9:97:72:ED   
          Bit Rate=65 Mb/s   Tx-Power=15 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=61/70  Signal level=-49 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:4  Invalid misc:65   Missed beacon:0

(在这个 12.04 ubuntu 上,lspci 显示与 xubuntu 13.04 加载完全相同的网络驱动程序和版本)

来自我的系统的一些杂项信息

  • cat /etc/lsb-release; uname -a
  • 请参阅lspci-nnk| grep -iA2 净
  • rfkill 列出全部
  • 修改
  • nm 工具
  • lsmod | grep rt2
  • sudo cat /var/log/syslog | grep -e rt2 -e firmware -e wpa -e wlan -e etork | tail -n75

$cat /etc/lsb-release; uname -a

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
Linux osiris 3.8.0-30-generic #44-Ubuntu SMP Thu Aug 22 20:52:24 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

$请参阅lspci-nnk| grep -iA2 净

02:00.0 Network controller [0280]: Intel Corporation Centrino Wireless-N 130 [8086:0896] (rev 34)
    Subsystem: Intel Corporation Centrino Wireless-N 130 BGN [8086:5005]
    Kernel driver in use: iwlwifi
03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller [10ec:8168] (rev 06)
    Subsystem: Samsung Electronics Co Ltd Device [144d:c0c1]
    Kernel driver in use: r8169

ric@osiris:~$rfkill 列出全部

0: samsung-wlan: Wireless LAN
    Soft blocked: no
    Hard blocked: no
...
3: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no

$修改

Module                  Size  Used by
pci_stub               12622  1 
vboxpci                23194  0 
vboxnetadp             25670  0 
vboxnetflt             23479  0 
vboxdrv               320372  3 vboxnetadp,vboxnetflt,vboxpci
parport_pc             28152  0 
ppdev                  17073  0 
rfcomm                 42641  16 
bnep                   18036  2 
binfmt_misc            17500  1 
snd_hda_codec_hdmi     36906  1 
snd_hda_codec_realtek    78399  1 
joydev                 17377  0 
arc4                   12615  2 
snd_hda_intel          39619  3 
snd_hda_codec         136498  3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
iwldvm                241872  0 
mac80211              606457  1 iwldvm
snd_hwdep              13602  1 snd_hda_codec
snd_pcm                97451  3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
snd_page_alloc         18710  2 snd_pcm,snd_hda_intel
coretemp               13355  0 
snd_seq_midi           13324  0 
snd_seq_midi_event     14899  1 snd_seq_midi
kvm_intel             132891  0 
kvm                   443165  1 kvm_intel
snd_rawmidi            30180  1 snd_seq_midi
i915                  600349  3 
uvcvideo               80847  0 
snd_seq                61554  2 snd_seq_midi_event,snd_seq_midi
videobuf2_vmalloc      13056  1 uvcvideo
nouveau               943184  0 
ghash_clmulni_intel    13259  0 
aesni_intel            55399  1 
snd_seq_device         14497  3 snd_seq,snd_rawmidi,snd_seq_midi
videobuf2_memops       13202  1 videobuf2_vmalloc
ttm                    83187  1 nouveau
aes_x86_64             17255  1 aesni_intel
drm_kms_helper         49394  2 i915,nouveau
xts                    12885  1 aesni_intel
lrw                    13257  1 aesni_intel
snd_timer              29425  2 snd_pcm,snd_seq
gf128mul               14951  2 lrw,xts
videobuf2_core         40513  1 uvcvideo
ablk_helper            13597  1 aesni_intel
videodev              129260  2 uvcvideo,videobuf2_core
iwlwifi               173516  1 iwldvm
btusb                  22474  0 
cryptd                 20373  3 ghash_clmulni_intel,aesni_intel,ablk_helper
lp                     17759  0 
drm                   286028  6 ttm,i915,drm_kms_helper,nouveau
microcode              22881  0 
cfg80211              510937  3 iwlwifi,mac80211,iwldvm
psmouse                95905  0 
bluetooth             228667  22 bnep,btusb,rfcomm
snd                    68876  16 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device
samsung_laptop         14532  0 
serio_raw              13215  0 
mei                    41158  0 
parport                46345  3 lp,ppdev,parport_pc
video                  19390  3 i915,samsung_laptop,nouveau
mxm_wmi                13021  1 nouveau
wmi                    19070  2 mxm_wmi,nouveau
i2c_algo_bit           13413  2 i915,nouveau
mac_hid                13205  0 
lpc_ich                17061  0 
soundcore              12680  1 snd
hid_generic            12540  0 
usbhid                 47074  0 
hid                   101002  2 hid_generic,usbhid
r8169                  67466  0 
ahci                   25731  5 
libahci                31364  1 ahci

$nm 工具

NetworkManager Tool

State: connected (global)

- Device: wlan0  [zzz-guests] --------------------------------------------------
  Type:              802.11 WiFi
  Driver:            iwlwifi
  State:             connected
  Default:           yes
  HW Address:        DC:A9:71:96:81:92

  Capabilities:
    Speed:           65 Mb/s

  Wireless Properties
    WEP Encryption:  yes
    WPA Encryption:  yes
    WPA2 Encryption: yes

  Wireless Access Points (* = current AP)
    zzz:             Infra, 00:1B:2F:94:ED:BE, Freq 2427 MHz, Rate 54 Mb/s, Strength 99 WPA WPA2
    *zzz-guests:     Infra, A4:B1:E9:97:72:ED, Freq 2462 MHz, Rate 54 Mb/s, Strength 72 WPA WPA2

  IPv4 Settings:
    Address:         192.168.1.64
    Prefix:          24 (255.255.255.0)sudo cat /var/log/syslog | grep -e rt2 -e firmware -e wpa -e wlan -e etork | tail -n75

    Gateway:         192.168.1.254

    DNS:             192.168.1.254

$ sudo cat/var/log/syslog| grep -e rt2 -e 固件 -e wpa -e wlan -e etork | tail -n75

Sep  7 14:04:26 osiris NetworkManager[1281]: <info> (wlan0): device state change: secondaries -> activated (reason 'none') [90 100 0]
Sep  7 14:04:26 osiris NetworkManager[1281]: <info> Policy set 'zzz-guests' (wlan0) as default for IPv4 routing and DNS.
Sep  7 14:04:28 osiris NetworkManager[1281]: <info> Activation (wlan0) successful, device activated.
Sep  7 14:04:44 osiris NetworkManager[1281]: <info> (wlan0): IP6 addrconf timed out or failed.
Sep  7 14:04:44 osiris NetworkManager[1281]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) scheduled...
Sep  7 14:04:44 osiris NetworkManager[1281]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) started...
Sep  7 14:04:44 osiris NetworkManager[1281]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) complete.
Sep  7 14:04:58 osiris wpa_supplicant[1376]: wlan0: WPA: Group rekeying completed with a4:b1:e9:97:72:ed [GTK=TKIP]
Sep  7 14:11:37 osiris wpa_supplicant[1376]: dbus: wpa_dbus_get_object_properties: failed to get object properties: (org.freedesktop.DBus.Error.Failed) failed to parse WPA IE
Sep  7 14:11:37 osiris wpa_supplicant[1376]: dbus: Failed to construct signal
Sep  7 14:14:58 osiris wpa_supplicant[1376]: wlan0: WPA: Group rekeying completed with a4:b1:e9:97:72:ed [GTK=TKIP]
Sep  7 14:17:37 osiris wpa_supplicant[1376]: dbus: wpa_dbus_get_object_properties: failed to get object properties: (org.freedesktop.DBus.Error.Failed) failed to parse WPA IE
Sep  7 14:17:37 osiris wpa_supplicant[1376]: dbus: Failed to construct signal
Sep  7 14:24:57 osiris wpa_supplicant[1376]: wlan0: WPA: Group rekeying completed with a4:b1:e9:97:72:ed [GTK=TKIP]

命令输出,stty

这里是 stty -a 的输出,包括本地和 ssh 到远程服务器之后的输出,两者都在 xubuntu 13.04(ssh 有问题)和 ubuntu 12.04 live(可以正常工作)中:

本地控制台(xubuntu 13.04):

$ stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?;
swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

从 xubuntu 13.04 通过 ssh 连接到远程服务器(centos 5.9):

$ stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

从 xubuntu 13.04 通过 ssh 连接到不同的服务器(ubuntu 10):

$ stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc ixany imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0

Ubuntu 12.04.2 LTS 上的本地控制台:

$ stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?;
swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

来自 ubuntu 12.04.2 的远程服务器(centos 5.9)

$ stty -a

speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt

Windows 7 上的 cygwin ssh -> centos 5.9

$ stty -a
speed 38400 baud; rows 24; columns 100; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;
min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel
-iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

Mac OS X 10.6.8

lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
    -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
    -extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel iutf8
    -ignbrk brkint -inpck -ignpar -parmrk
oflags: opost onlcr -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
    -dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
    eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
    min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
    stop = ^S; susp = ^Z; time = 0; werase = ^W;

12.04 ssh 到 centos 5.9

stty -g
500:5:bf:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

13.04 ssh 到 centos 5.9

stty -g
500:5:bf:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

(stty -g 输出相同)

(这个问题最初是在https://superuser.com/questions/640348/xubuntu-xterm-lag-echo-issue-with-ssh

答案1

关于诊断的更多想法:

  1. 分析 stty -a 的输出(已完成,确定排除,见下文讨论)

  2. 尝试使用其他网络设备访问网络。您是否遇到过同样的问题

    • 无线的
    • 以太网
    • usb-to-ethernet,或者 usb-to-wlan 适配器?
  3. 从 USB 启动另一个(非 Ubuntu)系统

你提到的 scp 测试会让我首先尝试 (2)。

答案2

我也遇到了同样的问题,但在我看来这是一个图形问题。将另一个窗口(部分)移到 xterm 窗口上会使 xterm 窗口刷新并显示丢失的行。有时还会显示一行的一半高度(字符的下半部分不显示)...

相关内容