【发布时间】:2021-06-21 15:36:47
【问题描述】:
我在 Raspberry PI(Raspbian GNU/Linux 10)上创建了一个简单的 systemd 服务,它启动了一个二进制文件
[Unit]
Description=Bestest description ever
[Service]
User=root
WorkingDirectory=/tmp
ExecStart=/home/pi/Documents/Repos/rpi3b-app/bin/rpi3b_app
Restart=always
[Install]
WantedBy=multi-user.target
当我启动 PI 时,它启动得很好,但是应用程序的行为很奇怪。这是我编写的 LED 灯条控制器应用程序,有问题的部分是 GPIO 引脚。真的不想写更多细节,因为我认为问题与 systemd 服务有关。
如果我手动停止服务,然后再次启动它,一切正常。停止并重新开始是指以下命令:
sudo systemctl stop controller.service
sudo systemctl start controller.service
我真的不明白这和我启动系统时自动启动有什么区别。希望有人有一个很好的提示,从哪里开始调查。
【问题讨论】:
标签: raspberry-pi systemd