Exec not working at all

Hello there,
I am very new to openHAB, so if i missed out on anything, I am happy to be pointed in the right direction.
I am quite experienced with Debian, so the Linux part should work out fine…

The thing I want to work is, to turn on my PC via a virtual Hue poweroutlet. As the WoL Binding seems wrather outdated and cannot be configured via Paper UI, I decided, to simply use the exec Binding and the wake on lan package avalable for Debian Linux. Waking the PC from the Linux commandline works like a charm, so no issues there.
So the next step was to whitelist the wakeonlan command, and creating a thing with the apropriate command. I doublechecked, enabled the openhab user to log into bash, and also from there, it worked. So i copied the command to the Openhab thing, configured it to follow a switch on the execution channel, and tried to flick the switch in PaperUI to get the PC to turn on…
Nothing. I thought, okay, maybe this is to complicated, I try to simply create a folder first. So I did some research, found out, that the /var/lib/openhab2 folder is the home folder, and tried to create a test folder. Not working. By now I have the feeling, that the Exec Binding is simply not executing my command when I flick the switch. I tried using the link Type Standard and Follow. Both seem not to work.
And sometimes, I cannot even flick the switch in PaperUI, so it seems my configuration in openHAB is just wrong.
So can anyone tell me what I am doing wrong?
https://community.openhab.org/t/how-to-solve-exec-binding-problems/18131
I followed these instructions. It is now trying to execute /bin/mkdir@@/var/lib/openhab2/test
I also chowned this folder to the openhab user to make sure it has permissions to write to it.
the openhab user can execute this command no problem, but exec does not seem to want to execute it…
Thanks for any help…

Showing us your exec Thing config would be helpful, if it’s not doing what you want.
Showing us what you do to make it happen would be helpful, i.e. have you something in your UI to click.
Showing us what happens would be helpful, i.e. the relevant sequence in your events.log

2 Likes

Okay, I have gotten one step further. Thanks for pointing me to the log files. Seems like my whitelist entry’s were not working. I added the complete command (/bin/mkdir@@/…) To the exec.whitelist. Before I just had the mkdir command in there. This worked perfectly. Do I need to specify every command to this degree, of would a simple /bin/mkdir@@* enable all mkdir executions? Also considering different arguments, like wakeonlan -i or sth. Like that.
Especially as I might want to wake up different machines, would I need to add every machine separately?

There are currently no wildcards in the exec whitelist. It’s a powerful weapon, with a safety catch to match.

Search this forum for “whitelist” for extensive discussions, complaints, tips and tricks.

XD
Yeah, indeed, it is very powerful, I was very happy, when I learned, that there is a interface to the command line, as I can now work with something I am familiar with
Thank you for your help!

1 Like

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