Iâve done just that. I wanted to make sure it solved your problem before making the edit.
If I recall correctly, when Debian Buster came out, it was unclear which commands would work in both Buster and Jessie. I had written this note:
EDIT: The code below has been updated to delete /sbin/reboot and add /sbin/shutdown and /sbin/systemctl, which should enable this tutorial to work with both the Debian Jessie and the newest Debian Buster operating systems. However, I have not personally tested/confirmed that it works on Debian Buster. See the discussion comments for more information, and please provide feedback if it does/doesnât work for you.
However, I didnât update the rule to match. Now that we know sbin/reboot works in Buster, itâs easiest to just add that back.
The problem was that the zram implementation in openHABian didnât work correctly when one used reboot as opposed to shutdown -r. That has since been resolved so both commands work correctly with zram now.
Well I wouldnât call it misconfigured. Itâs the default, and for good reasons so.
Under normal operating conditions, the openhab user should not need to have access to system level privileges.
The OP shouldnât be booting his server anyway.
Hello there! Iâm moving to OH3 and at this point iâm copying rules from my OH2 environment. I have 2 rules (working on OH2) that launch a reboot of service/shoutdown the servoce of OH2,but wonât work on OH3.
My command is: sudo systemctl restart openhab.service
Iâve followed above steps to update sudoers etc,but wonât work.
Btw, raspi reboot/shutdown are working correctly. I run rule on openhabian image and the command has been executed with executeCommandLine.
Last,if i run from ssh the command sudo systemctl restart openhwb.service, it shows me an info and then restart the service correctly without any other input.
Any help from any guru will be appreciated a lot.
Show your rules to get more help.
You adapted your executeCommandLine syntax from OH2 to the syntax of OH3 ?
In case it does not work get the returned string from executeCommandLine and print it to loginfo to check what the output message / error message is.