vnt-dev / vnt

An efficient VPN. 简便高效的异地组网、内网穿透工具
https://rustvnt.com
Apache License 2.0
1.36k stars 164 forks source link

Alpine Linux 3.20经常stop, 如何查找问题 #47

Closed molezz closed 4 months ago

molezz commented 5 months ago

Alpine Linux 3.20 下不管nohup还是使用openrc,一段时间后都会stop。 另外一个ubuntu22没出现

version 1.2.9
Serial:240
exe cmd: ifconfig vnt-tun txqueuelen 1000
create_tun name=vnt-tun ,version=
connect count=1 ,address=8.134.146.7:29872
handshake no_secret server version=1.2.9
register ip=10.26.0.23 ,netmask=255.255.255.0 ,gateway=10.26.0.1
exe cmd: ip route add 10.26.0.0/255.255.255.0 dev vnt-tun
exe cmd: ip route add 255.255.255.255/255.255.255.255 dev vnt-tun
exe cmd: ip route add 224.0.0.0/240.0.0.0 dev vnt-tun
 ====== Connect Successfully ====== 
stopped
#!/sbin/openrc-run
#supervisor=supervise-daemon
name="vnt"
command="vnt-cli"
command_args="-k xxx -n xxx --ip 10.26.0.23"
command_background=true
pidfile="/run/${name}.pid"
vnt-dev commented 5 months ago

打开日志看看,猜测可能是虚拟网卡出问题了。输出日志参考 #48

vnt-dev commented 5 months ago

是有什么操作出现了这种错误吗

molezz commented 5 months ago

nohup之后就没操作了, 也没有进行之间连接,最多--list看看, 都是p2p。可能还是这个alpine的问题了, ubuntu都没这问题

Name                                                                Virtual Ip    Status     P2P/Relay       Rt     
Alpine Linux 3.20.0_alpha20240329 [64-bit]    10.26.0.23    Offline                           
ub                                                                     10.26.0.2     Online     p2p             7      
ge                                                                      10.26.0.3     Online     p2p             2    
vnt-dev commented 5 months ago

具体运行的命令发出来看看呢,密码这些可以用*代替

molezz commented 5 months ago

ok, 最基本的运行的,多个ip, thanks nohup vnt-cli -k xxxi-7773 --ip 10.26.0.23 &

or cat /etc/init.d/vnt

#!/sbin/openrc-run
#supervisor=supervise-daemon
name="vnt"
command="vnt-cli"
command_args="-k xxxi-7773 -n palp --ip 10.26.0.23"
command_background=true
pidfile="/run/${name}.pid"
vnt-dev commented 5 months ago

好的 下个版本修复

molezz commented 5 months ago

这点信息,都能看出来问题 -__-

vnt-dev commented 5 months ago

就是程序没处理中断信号,忽略掉也许就好了,我不确定你这个系统为什么会这样

vnt-dev commented 5 months ago

我发个程序给你测试一下吧,方便吗

molezz commented 5 months ago

可以啊,alpine确实小众些,绝大部分局限于docker molezz@gmail.com

molezz commented 5 months ago

我发个程序给你测试一下吧,方便吗

一直没收到啊 @lbl8603 -_-!

vnt-dev commented 5 months ago

https://github.com/lbl8603/vnt/releases/tag/1.2.10.2 试试这个

molezz commented 5 months ago

好, 刚发现, test中

molezz commented 5 months ago

同目录下好像正常了,但是不同日志目录下有问题。 我再log同目录下nohup下

 # vnt-cli --list
cmd: Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }
vnt-dev commented 5 months ago

同目录下好像正常了,但是不同日志目录下有问题。 我再log同目录下nohup下

 # vnt-cli --list
cmd: Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }

没看懂,要使用同一个vnt-cli文件

molezz commented 5 months ago

是同一个, 都在usr/local/bin 不过cd到这个目录下nohup运行,含有log配置log4rs.yaml, 运行了很久没问题, 于是 --stop后 服务模式 service vnt restart 。 运行了一段时间报错了。 我还需要在测试看看复现否。

#!/sbin/openrc-run
#supervisor=supervise-daemon
name="vnt"
command="vnt-cli"
command_args="-k xxx -n xxx --ip 10.26.0.23"
command_background=true
pidfile="/run/${name}.pid"
vnt-dev commented 5 months ago

可能是运行目录不一样,vnt-cli --list 是依赖env目录下的port文件中记录的端口工作的

molezz commented 5 months ago

嗯 , 我没表述清楚,service restart后--list是正常的,一段时间后

 * status: crashed

再用--list 提示上述 cmd: Os { code: 111, kind: ConnectionRefused, message: "Connection refused" } 不过你提示后, 我打算修订严格下directory再试试

#!/sbin/openrc-run
#supervisor=supervise-daemon
directory="/usr/local/bin"
name="vnt"
command="/usr/local/bin/vnt-cli"
command_args="-k xxx -n xxx --ip 10.26.0.23"
command_background=true
pidfile="/run/${name}.pid"
vnt-dev commented 5 months ago

一段时间后服务异常,有异常日志吗

molezz commented 5 months ago

一段时间后服务异常,有异常日志吗

不好意思,终于出现了。 指定了directory依然出现, 仅限alpine。 ubuntu未出现。

2024-05-31T19:32:37.444843805+08:00 [vnt/src/channel/tcp_channel.rs:184] ERROR vnt::channel::tcp_channel:Os { code: 4, kind: Interrupted, message: "Interrupted system call" }
2024-05-31T19:32:37.444969541+08:00 [vnt/src/util/notify.rs:155] INFO vnt::util::notify:stop tcp_writable_handler
2024-05-31T19:32:37.446627814+08:00 [vnt/src/util/notify.rs:155] INFO vnt::util::notify:stop Scheduler
2024-05-31T19:32:37.446894370+08:00 [vnt/src/channel/udp_channel.rs:228] ERROR vnt::channel::udp_channel:Os { code: 4, kind: Interrupted, message: "Interrupted system call" }
2024-05-31T19:32:37.446927342+08:00 [vnt/src/util/notify.rs:155] INFO vnt::util::notify:stop main_udp
2024-05-31T19:32:37.447023899+08:00 [vnt/src/channel/udp_channel.rs:54] ERROR vnt::channel::udp_channel:Os { code: 4, kind: Interrupted, message: "Interrupted system call" }
2024-05-31T19:32:37.447083164+08:00 [vnt/src/util/notify.rs:155] INFO vnt::util::notify:stop sub_udp_listen
2024-05-31T19:32:37.447483308+08:00 [vnt/src/channel/tcp_channel.rs:63] ERROR vnt::channel::tcp_channel:Interrupted system call (os error 4)
2024-05-31T19:32:37.447541906+08:00 [vnt/src/util/notify.rs:155] INFO vnt::util::notify:stop tcp_listen
2024-05-31T19:32:37.488269741+08:00 [vnt/src/handle/tun_tap/unix.rs:57] ERROR vnt::handle::tun_tap::unix:Interrupted system call (os error 4)
vnt-dev commented 4 months ago

问题已解决 https://github.com/lbl8603/vnt/releases/tag/1.2.10.3