配置Homebridge的自启动服务

编辑打开文件:

sudo vi /etc/systemd/system/homebridge.service

写入下面文件内容:

[Unit]
Description=Homebridge
After=home-assistant@homeassistant.service
[Service]
Type=simple
User=root
ExecStart=/home/pi/.nvm/versions/node/v8.1.4/bin/homebridge -U /home/pi/.homebridge
[Install]
WantedBy=multi-user.target

加入自启动:

$ sudo systemctl daemon-reload
$ sudo systemctl enable homebridge.service

重启试试吧:

sudo reboot

 

Previous Post Next Post

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注