Hello everybody!
Quote:
Hardware:Raspberry Pi 4, software: raspbian buster, manually installed openHAB (from apt) and cec-client
|
Im trying to add my dumb-tv (HDMI-cec-enabled Toshiba) to my openHAB home automation system, to turn the TV on and off via cec-commands.
The command works fine for the default pi user, but the user openhab is unable to execute the command.
The cec-commands in question are: echo "standby 0 | cec-client RPI -s -d 1
and echo "on 0 | cec-client RPI -s -d 1
Ive tryed sudo su -u openhab echo "standby 0 | cec-client RPI -s -d 1
witch resulted in a new line in terminal, with only a ">".
"sudo su -u openhab ls" does show a list of items in the current folder, so it feels like the openhab user is not allowed to execute the cec-client program.
Now, i did find out the list of groups that these users belong to, and i figure that i might solve this issue by adding openhab to one of them, but i havent a clue regarding what specific group could be the important one...
pi@openHABserver:~$ groups pi
pi : pi adm tty dialout cdrom sudo audio video plugdev games users input netdev bluetooth spi i2c gpio openhab
pi@openHABserver:~$ groups openhab
openhab : openhab tty dialout audio bluetooth gpio
Ive searched the web, but im unable to find out how to check what permissions are needed to execute a program in linux..
And unfortunately, i will not be able to run my commands under another user, openHAB runs under openhab user and all commands executed thru openHAB will be executed as openhab, witch is not a member of sudoers, nor should it for security reasons.
So i need a way to fix this but my linux skills are rudimentary at best..
Does anyone have any ideas, hints or suggestions?