我试图在raspbian 11上创建一个新的systemd服务,但我得到了以下错误:
sysctl: cannot stat /proc/sys/homeassistant@homeassistant/service: No such file or directory
sysctl: cannot stat /proc/sys/start: No such file or directory以下是重现我的错误的步骤:
nano /etc/systemd/system/homeassistant@homeassistant.service档案内容:
[Unit]
Description=Home Assistant
After=network-online.target mariadb.service
[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/%i/.homeassistant"
Restart=on-failure
RestartSec=10s
[Install]
WantedBy=multi-user.target启用服务:
sysctl homeassistant@homeassistant.service enable收到的产出:
sysctl: cannot stat /proc/sys/homeassistant@homeassistant/service: No such file or directory
sysctl: cannot stat /proc/sys/start: No such file or directory发布于 2023-01-17 12:25:55
您需要使用systemctl命令来启用systemd单元(而不是用于在运行时修改内核参数的sysctl )。
https://unix.stackexchange.com/questions/732090
复制相似问题