这是我的 boondocks-agent.service 文件。我已经将它安装在 /lib/systemd/system 中:
[Unit]
Description=Boondocks agent
Requires=\
balena.service
After=\
balena.service
[Service]
Type=simple
Restart=always
RestartSec=10s
WatchdogSec=60
EnvironmentFile=/etc/boondocks-agent/agent.conf
EnvironmentFile=-/tmp/boondocks-agent.conf
ExecStartPre=-/usr/bin/stop-boondocks-agent
ExecStart=/usr/bin/healthdog --healthcheck=/usr/lib/boondocks-agent/boondocks-agent-healthcheck /usr/bin/start-boondocks-agent
ExecStop=-/usr/bin/stop-boondocks-agent
[Install]
WantedBy=multi-user.target
当我启动系统时,它似乎没有启动。干净启动后,这是我看到的状态:
systemctl status boondocks-agent
boondocks-agent.service - Boondocks agent
Loaded: loaded (/lib/systemd/system/boondocks-agent.service; disabled; vendor preset: enabled)
Active: inactive (dead)
我该怎么做才能让它在启动时自动启动?
编辑
在 YOCTO 中,相当于调用systemctl enable
的是:
SYSTEMD_SERVICE_${PN} = " \
boondocks-agent.service
"