luisiam / homebridge-cmdswitch2

CMD Plugin for HomeBridge (API 2.0): https://github.com/nfarina/homebridge
Apache License 2.0
176 stars 29 forks source link

No Permission to Turn on the Pi's Monitor #73

Closed nixmeer closed 2 years ago

nixmeer commented 2 years ago

Hello :)

I run homebridge as a service, just the standard way to install it, except I have no homebridge user (it uses the renamed pi user that I use for everything). The same Pi also runs my Magic Mirror, and I'd like it to turn on and off from the Home app. The commands I use are tvservice -o and tvservice -p & sudo chvt 6 & sudo chvt 7. If I log in over ssh and issue these commands, it works as expected. If I run homebridge from that same console, the cmdswitch works as well. However, if Homebridge is running as a service, chvt does not work. Its output is chvt: ioctl VT_ACTIVATE: operation not permitted. The same output is printed when I type these commands into the console of the web UI of homebridge.

So it seems to be a permission issue with the homebridge service. What do I need to do to get this plugin to have the missing permissions?

Best :)

nixmeer commented 2 years ago

Hello :) I got it fixed! I had to add CAP_SYS_TTY_CONFIG under CapabilityBoundingSet to the homebridge.service file. This capability was missing...

Thanks for the plugin!