After Update OH4.3.1 i can't execute reboot via Item

Hi,

before i use the old OH 4.2 i could reboot my RPi via Item.
Now i got this error after Updating to OH 4.3.1.

Error occurred when executing commandLine '[sudo@@reboot]'
java.io.IOException: Cannot run program "sudo@@reboot": error=2, Datei oder Verzeichnis nicht gefunden

rule:

rule "Reboot RPI"
when
    Item Flag_System received command "Reboot"
then
   	logInfo("Flag_System", "Rebooting openHAB")
    executeCommandLine("sudo@@reboot") //OH2 version
    //or
    executeCommandLine("sudo","reboot") //OH3 version with new executeCommandLine syntax
end

Your rule is executing

first. As you already commented in your rule that is the old syntax for openhab v2. Just delete this line.

nothing happen after i delete this line.
My system didn’t perform a reboot :frowning:

Are you sure that your rule was working before?
For a reboot you need elevated rights which require to enter a password. You can avoid this by changing the sudoers file. Did you do that or do you use oh exec binding?

Can you please post the log?

edit:
Please also change your command to:

var result = executeCommandLine(Duration.ofSeconds(2), "sudo", "reboot")
logInfo("Info", result)

when i try your code i got this feedback:

22:48:12.270 [INFO ] [org.openhab.core.model.script.Info   ] - sudo: Zum Lesen des Passworts ist ein Terminal erforderlich; verwenden Sie entweder die Option -S, um aus der Standardeingabe zu lesen oder richten Sie das Askpass-Hilfsprogramm ein
sudo: Ein Passwort ist notwendig

before my system reboot without any problem.

The command is issued as user openhab. The error indicates, that this user needs to enter a password for issuing commands with root priviliges.
If this has worked before the update, something has changed outside openhab.
You should check the sudo settings for user openhab.

after i following this instruction, it is working again.