Broke my Homebridge Integration

AFAIK NOOBS is just used to install Raspbian. Do you know if a different OS or version that would work better?

Good point about not using systemd until I get it back up and going. Previously I had it working well, then moved to Systemd for startup.

Oaky, after stopping systemd Homebridge and using it from pi. It is now working! No changes to the config file other then copying it....any ideas?

normal systemd instructions suggest you create a System user "homebridge"

When you run it yourself, you're probably user = "pi"

File and Directory rights are probably inconsistent.

Great point!

Here's the results:

First, forget about systemd, let’s get the plugin working. I assume you added a new user for Homebridge, correct? If so, su into that user account (Ned to be root to do so) and just start “homebridge”.
The error you are showing there is probably on start of Homebridge where it try’s to create its subdirectories in the config path. Does your new user have a home directory?

On a side note, I was talking to a different user not to long ago that just tried

On their rPI as the OS and stated that it was very straight forward to get the plugin running

via "homebridge" user

via pi via sudo su "homebridge"

This looks interesting...

your homebridge ID isn't built the way Homebridge needs.

There's no /home/homebridge (or no rights to homebridge the ID to the home directory)

$ grep homebridge /etc/passwd     
homebridge:x:999:996::/home/homebridge:

try that grep and verify that the ID was created properly. But it really does depend on who's systemd recipe you're following.


Looks correct to me.

that recipe has:

sudo useradd -M --system homebridge

the -M is

-M, --no-create-home
           Do no create the user's home directory

try

ls -l /home

I'm thinking it didn't get created. :slight_smile:

lowercase -m does create the home directory.

1 Like

If you are lazy, you can just do:

sudo mkdir /home/homebridge
sudo chown homebridge /home/homebridge

lazy/clueless...ha ha

Created the home directory. Copied config. I can now run Homebridge under the Homebridge user.

Now what do you think we should try, systemd again?

Yes, now I would try systemd again

:confused:

Can you post your homebridge.service file here. I see the one above, just want to make sure that it matches your local file.
Also, I would remove the whole “-U /var/lib/homebridge” from the /etc/default/homebridge file.

homebridge.service

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

[Service]
Type=simple
User=homebridge
EnvironmentFile=/etc/default/homebridge
# Adapt this to your specific setup (could be /usr/bin/homebridge)
# See comments below for more information
ExecStart=/usr/bin/homebridge $HOMEBRIDGE_OPTS
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target

Mine for reference:

[Unit]
Description=Homebridge
After=syslog.target network-online.target

[Service]
Type=simple
User=homebridge
EnvironmentFile=/etc/default/homebridge
ExecStart=/usr/bin/homebridge -I $HOMEBRIDGE_OPTS
Restart=on-failure
RestartSec=10
KillMode=process
CapabilityBoundingSet=CAP_IPC_LOCK CAP_SETGID CAP_NET_RAW CAP_NET_ADMIN CAP_SET$
AmbientCapabilities=CAP_NET_RAW

[Install]
WantedBy=multi-user.target

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.