新しいシステムサービスを作成できません

新しいシステムサービスを作成できません

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/[email protected]

文書の内容:

[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 [email protected] 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

ベストアンサー1

systemctlsystemdデバイスを有効にするには、このコマンドを使用する必要があります(sysctl実行時にカーネルパラメータを変更しないでください)。

おすすめ記事