Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Homebridge with elevated privileges? #3

Open
michis0806 opened this issue Sep 1, 2016 · 3 comments
Open

Run Homebridge with elevated privileges? #3

michis0806 opened this issue Sep 1, 2016 · 3 comments

Comments

@michis0806
Copy link

Simple n00b-question: how do I run homebridge with "elevated privileges"?

@KhaosT
Copy link
Owner

KhaosT commented Sep 3, 2016

sudo homebridge
On Thu, Sep 1, 2016 at 3:42 PM michis0806 [email protected] wrote:

Simple n00b-question: how do I run homebridge with "elevated privileges"?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#3, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ABpU4Mt2q3pg4IyOajffaoUFUodnhcwlks5qlz8GgaJpZM4JzImw
.

@ooii
Copy link

ooii commented Oct 2, 2017

But, how to start the homebridge service on ubuntu with elevated privileges?
I know I should ask the question on the homebridge repo but maybe you faced the issue and can help.

In my case, if I run sudo homebridge, everything is fine. But if I start the service with service homebridge start, it hangs at:

Load homebridge-amazondash.AmazonDash
Load homebridge-camera-ffmpeg.Camera-ffmpeg
Load homebridge-edomoticz.eDomoticz

Note that the other plugins work perfectly if I don't use the amazondash one and without sudo.

Here is my init.d/homebridge file:

dir="/home/user/.homebridge"
cmd="DEBUG=* /home/user/.npm-global/bin/homebridge"
user="root"

name=`basename $0`
pid_file="/var/run/$name.pid"
stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err"

get_pid() {
    cat "$pid_file"
}

is_running() {
    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
}

case "$1" in
    start)
   ...

Thanks.

@bobvann
Copy link

bobvann commented Apr 25, 2020

Actually, you may just give capabilities.

If you run the following command from root, you won't need root permission to use pcap.

setcap cap_net_raw,cap_net_admin=eip /usr/bin/node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants