首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用HandHeld丢失Debian <-> PDA / SynCE之间的PPP连接

使用HandHeld丢失Debian <-> PDA / SynCE之间的PPP连接
EN

Server Fault用户
提问于 2023-01-19 19:56:22
回答 1查看 63关注 0票数 0

我目前能够用一个非常老的Ubuntu14.04将手持设备连接到运行Linux的PC上,并将用于SynCE的存储库PPA添加到源代码列表中。现在,我们的目标是更新操作系统,我选择了Debian,在这里,我已经成功地在Ubuntu版本的同一个存储库中安装了DEB包。

在Debian中,USB串行设备被识别并与ttyUSB总线连接,获得一个IP地址,几秒钟后断开连接(2,最多3)。我做了PPP调试(选项调试转储和debug ),一切看起来都很正常:

代码语言:javascript
运行
复制
pppd options in effect:
debug       # (from /etc/ppp/options)
kdebug 7        # (from /etc/ppp/options)
logfile /tmp/pppd.log       # (from /etc/ppp/options)
linkname synce-device0      # (from command line)
dump        # (from /etc/ppp/options)
noauth      # (from command line)
/dev/ttyUSB0        # (from command line)
115200      # (from command line)
lock        # (from /etc/ppp/options)
connect /usr/lib/synce-core/synce-serial-chat       # (from command line)
record /tmp/pppd.pcap       # (from /etc/ppp/options)
crtscts     # (from command line)
local       # (from command line)
asyncmap 0      # (from /etc/ppp/options)
lcp-echo-failure 4      # (from /etc/ppp/options)
lcp-echo-interval 30        # (from /etc/ppp/options)
hide-password       # (from /etc/ppp/options)
ms-dns xxx # [don't know how to print value]        # (from command line)
nodefaultroute      # (from command line)
192.168.131.1:192.168.131.129       # (from command line)
noipx       # (from /etc/ppp/options)
Removed stale lock on ttyUSB0 (pid 4366)
Script /usr/lib/synce-core/synce-serial-chat finished (pid 4435), status = 0x0
Serial connection established.
using channel 14
Using interface ppp0
Connect: ppp0 <--> /dev/pts/3
rcvd [LCP ConfReq id=0x0 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xf230f2eb> <pcomp> <accomp>]
sent [LCP ConfAck id=0x0 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xf230f2eb> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xf230f2eb]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 192.168.131.1>]
rcvd [CCP ConfReq id=0x0 <mppe -H -M -S -L -D +C>]
sent [CCP ConfRej id=0x0 <mppe -H -M -S -L -D +C>]
rcvd [IPCP ConfReq id=0x2 <compress VJ 0f 00> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-wins 0.0.0.0> <ms-dns2 0.0.0.0> <ms-wins 0.0.0.0>]
sent [IPCP ConfRej id=0x2 <ms-wins 0.0.0.0> <ms-wins 0.0.0.0>]
rcvd [IPV6CP ConfReq id=0x0 <addr fe80::4283:deff:feae:dec9>]
Unsupported protocol 'IPv6 Control Protocol' (0x8057) received
sent [LCP ProtRej id=0x2 80 57 01 00 00 0e 01 0a 42 83 de ff fe ae de c9]
rcvd [LCP EchoRep id=0x0 magic=0x0]
rcvd [CCP ConfRej id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [CCP ConfReq id=0x2]
rcvd [IPCP ConfAck id=0x1 <compress VJ 0f 01> <addr 192.168.131.1>]
rcvd [CCP ConfReq id=0x1]
sent [CCP ConfAck id=0x1]
rcvd [IPCP ConfReq id=0x3 <compress VJ 0f 00> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfNak id=0x3 <addr 192.168.131.129> <ms-dns1 192.168.131.1> <ms-dns2 192.168.131.1>]
rcvd [CCP ConfNak id=0x2 <mppe -H -M -S -L -D +C>]
sent [CCP ConfReq id=0x3]
rcvd [IPCP ConfReq id=0x4 <compress VJ 0f 00> <addr 192.168.131.129> <ms-dns1 192.168.131.1> <ms-dns2 192.168.131.1>]
sent [IPCP ConfAck id=0x4 <compress VJ 0f 00> <addr 192.168.131.129> <ms-dns1 192.168.131.1> <ms-dns2 192.168.131.1>]
local  IP address 192.168.131.1
remote IP address 192.168.131.129
Script /etc/ppp/ip-up started (pid 4444)
rcvd [CCP ConfAck id=0x3]
Script /etc/ppp/ip-up finished (pid 4444), status = 0x0

在UDEV中,我看到在"add“事件之后,它从内核中触发一个"remove",而没有断开设备的连接。引人注目的是,该事件仅与ppp0网络设备相关联。

代码语言:javascript
运行
复制
KERNEL[13133.932298] add      /devices/pci0000:00/0000:00:06.0/usb2/2-2 (usb)
KERNEL[13133.941859] add      /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0 (usb)
KERNEL[13133.946512] add      /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/ttyUSB0 (usb-serial)
KERNEL[13133.946847] add      /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/ttyUSB0/tty/ttyUSB0 (tty)
KERNEL[13133.946887] bind     /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/ttyUSB0 (usb-serial)
KERNEL[13133.946930] bind     /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0 (usb)
KERNEL[13133.947016] bind     /devices/pci0000:00/0000:00:06.0/usb2/2-2 (usb)
UDEV  [13133.951550] add      /devices/pci0000:00/0000:00:06.0/usb2/2-2 (usb)
UDEV  [13133.967665] add      /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0 (usb)
UDEV  [13133.969926] add      /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/ttyUSB0 (usb-serial)
UDEV  [13133.993251] add      /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/ttyUSB0/tty/ttyUSB0 (tty)
UDEV  [13134.002291] bind     /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/ttyUSB0 (usb-serial)
UDEV  [13134.003803] bind     /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0 (usb)
UDEV  [13134.004620] bind     /devices/pci0000:00/0000:00:06.0/usb2/2-2 (usb)
KERNEL[13134.445488] add      /devices/virtual/net/ppp0 (net)
KERNEL[13134.445509] add      /devices/virtual/net/ppp0/queues/rx-0 (queues)
KERNEL[13134.445519] add      /devices/virtual/net/ppp0/queues/tx-0 (queues)
UDEV  [13134.498959] add      /devices/virtual/net/ppp0 (net)
UDEV  [13134.510588] add      /devices/virtual/net/ppp0/queues/rx-0 (queues)
UDEV  [13134.514145] add      /devices/virtual/net/ppp0/queues/tx-0 (queues)
<< a little few seconds later >>
KERNEL[13137.624110] remove   /devices/virtual/net/ppp0/queues/rx-0 (queues)
KERNEL[13137.624144] remove   /devices/virtual/net/ppp0/queues/tx-0 (queues)
KERNEL[13137.624169] remove   /devices/virtual/net/ppp0 (net)
UDEV  [13137.644633] remove   /devices/virtual/net/ppp0/queues/tx-0 (queues)
UDEV  [13137.644791] remove   /devices/virtual/net/ppp0/queues/rx-0 (queues)
UDEV  [13137.659488] remove   /devices/virtual/net/ppp0 (net)

该事件与网络接口或网络协议有关,但我没有看到导致此事件的任何原因。通过查看Whireshark (记录到pcap )的网络流量,我没有发现任何线索。我已经与Ubuntu中的连接进行了比较,我没有看到任何东西。在Ubuntu中,尽管使用了RST,但连接从未丢失(见下图)。

https://i.stack.imgur.com/c0RKA.png

在Debian上,它突然丢失了。

https://i.stack.imgur.com/43vtk.png

目标是在USB串行设备和Linux PC之间建立一个TCP/IP稳定的连接:ppp0 <--> /dev/ttyUSB0目前使用Debian,连接在几秒钟内(2或3)就丢失了.

代码语言:javascript
运行
复制
Jan 18 20:26:56 debian10 pppd[1590]: local  IP address 192.168.131.1
Jan 18 20:26:56 debian10 pppd[1590]: remote IP address 192.168.131.129
Jan 18 20:26:56 debian10 dccm[1505]: DEBUG: synce_device_manager_check_interface_cb: address ready
Jan 18 20:26:56 debian10 dccm[1505]: DEBUG: synce_device_manager_create_device: found device interface for /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/ttyUSB0/tty/ttyUSB0
Jan 18 20:26:56 debian10 dccm[1505]: DEBUG: synce_device_manager_create_device: listening for device /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/ttyUSB0/tty/ttyUSB0
Jan 18 20:26:56 debian10 dccm[1505]: DEBUG: synce_device_manager_create_device: NOT triggering connection
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_manager_client_connected_cb: have a connection to port 5679
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_manager_client_connected_cb: creating device object for /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/ttyUSB0/tty/ttyUSB0
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_set_property: running for device /devices/pci0000:00/0000:00:06.0/usb2/2-2/2-2:1.0/ttyUSB0/tty/ttyUSB0
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_initable_init: connecting to udev
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: info buffer length = 138
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 0: unknown: guint32 ?: 40
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 4: os_major: guint8: 6
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 5: os_minor: guint8: 0
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 6: unknown, build number ?: guint16 ?: 0
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 8: cpu_type: guint16: 2577
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 10: unknown: guint16 ?: 0
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 12: unknown: guint32 ?: 0
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 16: cur_partner_id: guint32: 0
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 20: second partner id ?: guint32 ?: 0
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 24: offset to device name: guint32: 40
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 28: offset to platform name: guint32: 74
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: offset 32: offset to model name: guint32: 104
Jan 18 20:26:57 debian10 dccm[1505]: Message: synce_device_dbus_init: registering object path '/org/synce/dccm/Device/_devices_pci0000_00_0000_00_06_0_usb2_2_2_2_2_1_0_ttyUSB0_tty_ttyUSB0'
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_manager_device_obj_path_changed_cb: sending connected signal for /org/synce/dccm/Device/_devices_pci0000_00_0000_00_06_0_usb2_2_2_2_2_1_0_ttyUSB0_tty_ttyUSB0
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_dbus_init: obj_path set to /org/synce/dccm/Device/_devices_pci0000_00_0000_00_06_0_usb2_2_2_2_2_1_0_ttyUSB0_tty_ttyUSB0
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: get_password_flag_text: setting password flags unset
Jan 18 20:26:57 debian10 dccm[1505]: DEBUG: synce_device_legacy_info_received: setting CTRL_STATE_CONNECTED
Jan 18 20:26:58 debian10 dccm[1505]: DEBUG: gudev_uevent_callback: received uevent **remove** for device /sys/devices/virtual/net/ppp0/queues/tx-0
Jan 18 20:26:58 debian10 dccm[1505]: DEBUG: gudev_uevent_callback: received uevent **remove** for device /sys/devices/virtual/net/ppp0/queues/rx-0
Jan 18 20:26:58 debian10 dccm[1505]: DEBUG: gudev_uevent_callback: received uevent **remove** for device /sys/devices/virtual/net/ppp0

如何检测正在发生的事情?内核删除ppp0设备的原因是什么?任何有助于解决这个问题的答案都将受到高度赞赏,即使有另一种方式连接USB串行设备,我也不知道是否有。

EN

回答 1

Server Fault用户

发布于 2023-04-10 18:16:00

udev手册给了我一个答复:

不允许启动守护进程或其他长时间运行的进程;分离或不分离的分叉进程将在事件处理完成后无条件地终止。为了从udev规则中激活长时间运行的进程,提供一个服务单元并使用SYSTEMD_WANTS设备属性从udev设备中提取它。

更新的udev版本(来自Ubuntu 16和Debian 8)通过对udev事务和由udev生成的进程有严格的时间限制,使您无法在运行或程序脚本中启动长期存在的后台进程。至于对udev派生脚本的长时间运行的进程限制,如果您在后台启动一些东西,只要udev启动的实际脚本很快终止。Udev使用cgroup寻找n个销毁生成的任务。

systemd路由是正确的方法,因为不建议从udev开始长期运行的进程。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1120663

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档