homebridge: Unable to run Homebridge on Bootup Raspberry Pi

I followed the instruction [https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi] to set up auto start on boot.

When I type sudo /etc/init.d/homebridge start, it just doesn’t do anything

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 22 (3 by maintainers)

Most upvoted comments

Personally, I prefer to run Homebridge with forever.

Here’s my script in /etc/init.d/homebridge

#!/bin/sh

case "$1" in
    start)
        su - pi -c "forever start  --spinSleepTime 5000 --sourceDir=/usr/local/bin homebridge" 
        ;;
    stop)
        su - pi -c "forever stopall"
        forever stopall
        ;;
    restart)
        su - pi -c "forever restartall"
        forever restartall
        ;;
    status)
        su - pi -c "forever list"
        forever list
        ;;
esac

exit 0

Just a quick tip, on latest Node, Homebridge is not located on /usr/local/lib but in /usr/lib. Just change the line cmd="DEBUG=* /usr/local/bin/homebridge" into cmd="DEBUG=* /usr/bin/homebridge" and it works like a charm

Here is my guide in setting up Homebridge on Raspberry Pi to start on boot up and restart on errors. Hope it help! https://timleland.com/setup-homebridge-to-start-on-bootup/