即使设备已列出并且状态可查询,也无法向设备添加想要的服务

即使设备已列出并且状态可查询,也无法向设备添加想要的服务

LPD8是一个音乐物理硬件。插入时,我希望它能够启动Fluidsynth 合成器。在 Debian 上,有一个fluidsynth.service运行--user合成器的实例。

Systemd 在插入设备后即可识别该设备:

$ systemctl --user list-units --type=device

UNIT                                                                                                LOAD   ACTIVE         DESCRIPTION
...
sys-devices-platform-soc-1c1a000.usb-usb1-1\x2d1-1\x2d1.3-1\x2d1.3:1.0-sound-card1-controlC1.device loaded active plugged LPD8
...

我可以以描述和单位形式查询 LPD8 的状态:

$ systemctl status LPD8.device

○ LPD8.device - /LPD8
     Loaded: loaded
     Active: inactive (dead)


$ systemctl status sys-devices-platform-soc-1c1a000.usb-usb1-1\x2d1-1\x2d1.3-1\x2d1.3:1.0-sound-card1-controlC1.device

○ sys-devices-platform-soc-1c1a000.usb-usb1-1x2d1-1x2d1.3-1x2d1.3:1.0-sound-card1-controlC1.device - /sys/devices/platform/soc/1c1a000.usb/usb1/1x2d1/1x2d1.3/1x2d1.3:1.0/sound/card1/controlC1
     Loaded: loaded
     Active: inactive (dead)

但是,我无法add-wants连接fluidsynth.service到 LPD8 设备:systemd 似乎抱怨缺少设备文件。

$ systemctl --user add-wants LPD8.device fluidsynth.service
Failed to add dependency: Unit file LPD8.device does not exist.

$ systemctl --user add-wants sys-devices-platform-soc-1c1a000.usb-usb1-1\x2d1-1\x2d1.3-1\x2d1.3:1.0-sound-card1-controlC1.device fluidsynth.service
Failed to add dependency: Unit file sys-devices-platform-soc-1c1a000.usb-usb1-1x2d1-1x2d1.3-1x2d1.3:1.0-sound-card1-controlC1.device does not exist.

fluidsynth.service当 LPD8 插入时就能够启动,我错过了什么?

相关内容