Help with openhab restart button

Can you please advise me how to create command to execute openhab restart?
I have added exec binding, set item and thing but not sure how to execute this command:

String openhab_restart “Restart Openhab” { channel=“exec:command:openhab_restart:input”, autoupdate=“false” }

Thing exec:command:openhab_restart [command=“sudo systemctl restart openhab2.service”, interval=0, autorun=true]


The most likely problem is the openhab user is not a member of sudoers.

Just out of curiosity why would you have a reset button in your sitemap?

I have done similar to you, to restart the ola(light service) on the rpi,

I added a physically switch to cut power to rpi, however maybe a good idea would have been to attach this to an gpio an use an outside openhab script to listen on this pin and then restart openhab

i had many instances when binding has stopped working and only restart helps. I want to be able to control it remotely without logging into rpi.

Thank you. This is what I have done and checked for the openhabian permissions to execute without the password.