我正在尝试使用 udev 规则通过 systemctl 启动服务。
SUBSYSTEM=="tty", ATTRS{manufacturer}=="Belkin USB PDA Adapter", ATTRS{serial}=="778452", RUN+="/usr/bin/systemctl start [email protected]"
关于失败的系统日志
Mar 23 18:04:39 pi4 kernel: [289664.631249] usb 1-1.1: new full-speed USB device number 13 using xhci_hcd
Mar 23 18:04:39 pi4 kernel: [289664.781515] usb 1-1.1: New USB device found, idVendor=050d, idProduct=0109, bcdDevice= 1.02
Mar 23 18:04:39 pi4 kernel: [289664.781534] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 23 18:04:39 pi4 kernel: [289664.781550] usb 1-1.1: Manufacturer: Belkin USB PDA Adapter
Mar 23 18:04:39 pi4 kernel: [289664.781565] usb 1-1.1: SerialNumber: 778452
Mar 23 18:04:39 pi4 kernel: [289664.786461] mct_u232 1-1.1:1.0: MCT U232 converter detected
Mar 23 18:04:39 pi4 kernel: [289664.786747] usb 1-1.1: MCT U232 converter now attached to ttyUSB0
Mar 23 18:04:48 pi4 systemd[1]: dev-ttyUSB0.device: Job dev-ttyUSB0.device/start timed out.
Mar 23 18:04:48 pi4 systemd[1]: Timed out waiting for device /dev/ttyUSB0.
Mar 23 18:04:48 pi4 systemd[1]: Dependency failed for Serial Getty on ttyUSB0.
Mar 23 18:04:48 pi4 systemd[1]: [email protected]: Job [email protected]/start failed with result 'dependency'.
Mar 23 18:04:48 pi4 systemd[1]: dev-ttyUSB0.device: Job dev-ttyUSB0.device/start failed with result 'timeout'.
Mar 23 18:04:48 pi4 systemd-udevd[1288]: Process '/usr/bin/systemctl start [email protected]' failed with exit code 1.
然而,当我手动运行时,服务启动得很好。在我的 udev 规则中,我对 RUN+= 做错了什么明显的事情吗?systemctl start [email protected]