我写了一个程序(节点 js,在 Raspberry Pi 上),我可以手动启动,但不能作为 systemd 服务:
pi@blueberry ~ $ systemd --version
systemd 215
+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR
pi@blueberry ~ $ sudo systemctl daemon-reload
pi@blueberry ~ $ sudo systemctl start /etc/systemd/system/rfxtrx.service
Failed to start etc-systemd-system-rfxtrx.service.mount: Unit etc-systemd-system-rfxtrx.service.mount failed to load: No such file or directory.
pi@blueberry ~ $
Run Code Online (Sandbox Code Playgroud)
错误消息抱怨没有 rfxtrx.service.mount 单元。正确的。应该有这样的单位吗?最常见的建议是 daemon-reload;这没有帮助。或者根据https://github.com/systemd/systemd/issues/5375,这可能是 systemd 中的一个错误,该错误已修复,但仅在比 raspbian 中的 systemd 版本更高的 systemd 版本中(raspbian 的版本为 215)。
除了尝试更新到 raspbian 维护者不支持的版本之外,还有其他解决方案吗?