tmux-连接失败:连接被拒绝

时间:2019-03-18 13:11:21

标签: tmux

我想在rhel 7上使用tmux。我在这台机器上没有root权限,所以我通过遵循以下过程从源代码构建它:https://jdhao.github.io/2018/10/16/tmux_build_without_root_priviledge/

我已经在本地构建并安装了libevent 2.1.8,ncurses 6.1和tmux 2.8。它们都安装在〜/ local。

启动tmux时,它不会启动。我收到的消息是:

  

[退出]

我再次使用-vv选项开始,我得到了日志。

在服务器端,我得到:

1552914150.215313 server started (1698): version 2.8, socket /tmp/tmux-130772/default, protocol 8
1552914150.215360 on Linux 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015; libevent 2.1.8-stable (poll)
1552914150.224069 bind-key: argv[0]=bind
...
1552914150.293655 cmd_find_from_session_window: s=$0 0
1552914150.293661 cmd_find_from_session_window: wl=0 1 w=@0 ksh
1552914150.293666 cmd_find_from_session_window: wp=none
1552914150.293671 cmd_find_from_session_window: idx=0
1552914150.293677 session_add_ref: 0 notify_add, now 4
1552914150.293682 window_add_ref: @0 notify_add, now 3
1552914150.293687 session_add_ref: 0 notify_add, now 5
1552914150.293694 window_remove_ref: @0 winlink_remove, now 2
1552914150.293700 session 0 destroyed (session_detach)
1552914150.293706 cmd_find_best_session: 0 sessions to try
1552914150.293712 session_add_ref: 0 notify_add, now 6
1552914150.293719 session_remove_ref: 0 session_destroy, now 5
1552914150.293731 cmdq_next <global>: enter
1552914150.293744 cmdq_next <global>: callback[notify_callback] (1), flags 0
1552914150.293750 notify_callback: pane-exited
1552914150.293756 cmd_find_best_session: 0 sessions to try
1552914150.293761 session_remove_ref: 0 notify_callback, now 4
1552914150.293768 cmdq_next <global>: callback[notify_callback] (1), flags 0
1552914150.293773 notify_callback: window-layout-changed
1552914150.293779 cmd_find_best_session: 0 sessions to try
1552914150.293784 window_remove_ref: @0 notify_callback, now 1
1552914150.293790 session_remove_ref: 0 notify_callback, now 3
1552914150.293795 cmdq_next <global>: callback[notify_callback] (1), flags 0
1552914150.293800 notify_callback: window-unlinked
1552914150.293806 cmd_find_best_session: 0 sessions to try
1552914150.293811 session_remove_ref: 0 notify_callback, now 2
1552914150.293817 window_remove_ref: @0 notify_callback, now 0
1552914150.293822 window @0 destroyed (0 references)
1552914150.293828 session_remove_ref: 0 notify_callback, now 1
1552914150.293834 cmdq_next <global>: callback[notify_callback] (1), flags 0
1552914150.293839 notify_callback: session-closed
1552914150.293845 cmd_find_best_session: 0 sessions to try
1552914150.293851 session_remove_ref: 0 notify_callback, now 0
1552914150.293859 cmdq_next <global>: exit (empty)
1552914150.293865 cmdq_next <0x2363520>: empty
1552914150.293870 cmdq_next <global>: empty
1552914150.293875 cmdq_next <0x2363520>: empty
1552914150.293881 cmd_find_best_session: 0 sessions to try
1552914150.293889 sending message 203 to peer 0x2363d60 (4 bytes)
1552914150.293903 session 0 freed (0 references)
1552914150.293922 cmdq_next <global>: enter
1552914150.293930 cmdq_next <global>: callback[notify_callback] (1), flags 0
1552914150.293935 notify_callback: client-detached
1552914150.293941 cmd_find_best_session: 0 sessions to try
1552914150.293947 unref client 0x2363520 (2 references)
1552914150.293952 cmdq_next <global>: exit (empty)
1552914150.293957 cmdq_next <0x2363520>: empty
1552914150.293962 cmdq_next <global>: empty
1552914150.293967 cmdq_next <0x2363520>: empty
1552914150.302142 peer 0x2363d60 message 205
1552914150.302286 sending message 204 to peer 0x2363d60 (0 bytes)
1552914150.302301 cmdq_next <global>: empty
1552914150.302308 cmdq_next <0x2363520>: empty
1552914150.302333 cmdq_next <global>: empty
1552914150.302340 cmdq_next <0x2363520>: empty
1552914150.311857 lost client 0x2363520
1552914150.311902 remove peer 0x2363d60
1552914150.311935 unref client 0x2363520 (1 references)
1552914150.311975 free client 0x2363520 (0 references)
1552914150.311988 cmdq_next <global>: empty
1552914150.312000 server loop exit

在客户端:

1552914150.208220 client started (1696): version 2.8, socket /tmp/tmux-130772/default, protocol 8
1552914150.208308 on Linux 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015; libevent 2.1.8-stable (poll)
1552914150.208351 socket is /tmp/tmux-130772/default
1552914150.208370 trying connect
1552914150.208401 connect failed: Connection refused
1552914150.208419 lock file is /tmp/tmux-130772/default.lock
1552914150.208478 flock succeeded
1552914150.208486 got lock (6)
1552914150.208495 trying connect
1552914150.208509 connect failed: Connection refused
1552914150.208779 add peer 0x23302e0: 7 ((nil))
...

我唯一看到的是客户端无法连接套接字。我没有在服务器端发现任何错误。

我想知道是什么导致tmux无法正常启动。

1 个答案:

答案 0 :(得分:1)

详尽的分析表明,tmux使用的默认外壳在我的环境中退出时出现错误。

我通过强制使用另一个shell解决了问题。我将其放在.tmux.conf中:set-option -g default-shell /bin/zsh