编辑打开文件:
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