您尚未登录。

#1 2024-02-12 14:19:53

hu
会员
注册时间: 2023-03-11
帖子: 26

ssh断开连接后tmux被杀死

打算用笔记本爆改服务器,但是ssh连接断开后tmux中的任务就被杀了
无论使用什么任务调度器都不好使

离线

#2 2024-02-12 14:20:47

hu
会员
注册时间: 2023-03-11
帖子: 26

Re: ssh断开连接后tmux被杀死

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 (rev f1)
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-LP LPC Controller (rev 21)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce MX130] (rev a2)
02:00.0 Network controller: Intel Corporation Wireless 3165 (rev 81)

离线

#3 2024-02-12 21:38:26

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,495
个人网站

Re: ssh断开连接后tmux被杀死

loginctl enable-linger 大概就可以了。如果还不行,那就手动用 systemd-run --user 把 tmux 丢进服务里运行。

离线

#4 2024-02-12 23:44:41

hu
会员
注册时间: 2023-03-11
帖子: 26

Re: ssh断开连接后tmux被杀死

だめ,两个都不好使,只要ssh断开,tmux就会被格杀勿论,切换用户运行也不行
1707718731.951684 client started (1625): version 3.3a, socket /tmp/tmux-1000/default, protocol 8
1707718731.951705 on Linux 6.1.77-x64v1-xanmod1-1-lts #1 SMP PREEMPT_DYNAMIC Wed, 07 Feb 2024 05:02:10 +0000
1707718731.951709 using libevent 2.1.12-stable (poll); ncurses 6.4
1707718731.951732 flags are 0x18010000
1707718731.951736 socket is /tmp/tmux-1000/default
1707718731.951746 trying connect
1707718731.951756 connect failed: Connection refused
1707718731.951764 lock file is /tmp/tmux-1000/default.lock
1707718731.951777 flock succeeded
1707718731.951780 got lock (6)
177718731.951786 trying connect
1707718731.951795 connect failed: Connection refused
1707718731.952012 add peer 0x562f195f5050: 7 ((nil))
1707718731.952367 sending message 100 to peer 0x562f195f5050 (4 bytes)
1707718731.952373 sending message 111 to peer 0x562f195f5050 (8 bytes)
1707718731.952376 sending message 101 to peer 0x562f195f5050 (15 bytes)
1707718731.952380 sending message 109 to peer 0x562f195f5050 (4 bytes)
1707718731.952383 sending message 102 to peer 0x562f195f5050 (11 bytes)
1707718731.952386 sending message 108 to peer 0x562f195f5050 (9 bytes)
1707718731.952389 sending message 112 to peer 0x562f195f5050 (58 bytes)
1707718731.952393 sending message 112 to peer 0x562f195f5050 (5 bytes)
1707718731.952396 sending message 112 to peer 0x562f195f5050 (5 bytes)
1707718731.952399 sending message 112 to peer 0x562f195f5050 (6 bytes)
1707718731.952402 sending message 112 to peer 0x562f195f5050 (6 bytes)
1707718731.952406 sending message 112 to peer 0x562f195f5050 (11 bytes)
1707718731.952409 sending message 112 to peer 0x562f195f5050 (10 bytes)
-- 插入 --                                                                                                                               11,3         顶端

最近编辑记录 hu (2024-02-13 00:22:13)

离线

#5 2024-02-13 00:39:51

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,495
个人网站

Re: ssh断开连接后tmux被杀死

看一下日志。

离线

#6 2024-02-18 21:55:37

hu
会员
注册时间: 2023-03-11
帖子: 26

Re: ssh断开连接后tmux被杀死

重装了一遍后,运行不到一周tmux就无法连接了,日志竟然和之前的一致
都是ssh退出后系统就把tmux干掉了,所以tmux无法连接/tmp/tmux-1000/default
问题还是出现在ssh或者systemd上

离线

#7 2024-02-18 22:03:25

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,495
个人网站

Re: ssh断开连接后tmux被杀死

看一下 journalctl 里相关的日志。

离线

页脚