Skip to content

Instantly share code, notes, and snippets.

@ntamvl
Last active June 26, 2020 07:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntamvl/770e9dc6cbfe171354fc48d783490f86 to your computer and use it in GitHub Desktop.
Save ntamvl/770e9dc6cbfe171354fc48d783490f86 to your computer and use it in GitHub Desktop.
Systemd Service for homebridge on Raspberry Pi (http://github.com/nfarina/homebridge)

Systemd Service for homebridge on Raspberry Pi

Check location of homebridge

pi@raspberrypi:~/.homebridge $ which homebridge
/usr/bin/homebridge

Create file /etc/systemd/system/homebridge.service

[Unit]
Description=Node.js HomeKit Server 
After=syslog.target network-online.target

[Service]
Type=simple
User=pi
ExecStart=/usr/bin/homebridge
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target

Then Enable and run the service (first time) with the following commands:

sudo systemctl daemon-reload
sudo systemctl enable homebridge
sudo systemctl start homebridge

You can check the status of the service by calling

sudo systemctl status homebridge

Check logs

sudo journalctl -u homebridge 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment