etwmc/Personal-HomeKit-HAP

Startup on boot raspberry

Closed this issue · 6 comments

rooi commented

Hi,

I've got a good setup with the dynamic fork and would like to start it at boot on my raspberry. Unfortunately it does not work using the way described in the wiki. One thing I noticed is that is starts using root user, perhaps this causes problems.

The controller file is created and the service seems running, however I cannot add the accessory on my phone.

Does anyone have an idea on what causes this problem? I tries to su - xbian in the homekit file located in the /etc/init.d, but it did not work (probably did something wrong though..)

Thanks!
Roy

Likely a file permission issue during the paring process.

Try adding --chuid root:root option to line 48

start-stop-daemon --start --quiet -b --chuid root:root --pidfile $PIDFILE --make-pidfile --exec $DAEMON -- \

I assume you updated the daemon path on line 18

rooi commented

thanks @elvisimprsntr!

It was a permission issue indeed. I changed it to user xbian and also changed the path such that my lightapi can be located as well.

Post the exact changes and I will update the wiki

Hi, just wondering if there was any update on this?
I'm trying to get this to run on boot on a pi, I've tried the suggestions above.

rooi commented

Hi,

Sorry for the late reply, I missed this one.
I changed to the local user id like your said:

start-stop-daemon --start --quiet --chuid xbian:xbian --pidfile $PIDFILE --exec $DAEMON --test > /dev/null

Besides this, I needed to change the path such that it can find the programs I call from the PHK (lightwaverf and logitech harmony in my case). It probably is specific to my setup as well, but I changed it into:

PATH=/usr/local/bin/:/sbin:/usr/sbin:/bin:/usr/bin

Perhaps you can include some pointers in the wiki? Hope this helps someone

Roy