Exec 2.2.0 - configuration question

Hi,
my 1.83. exec rules do not work anymore with 2.2.0 snapshot…
I now checked in documentations that in v2 there is a thing/channel configuration required.
My Question, is the old style (look below) still working with v2.

rule "ETA SH20_Start/Stop Logger"
when
    Item EtaKesselState received update
then
    if (EtaKesselState.state=="Heizen" && EtaState_Switch.state==OFF) {
       executeCommandLine("/etc/openhab2/scripts/etastart.sh")
       EtaState_Switch.sendCommand(ON) }
    else
    if (EtaKesselState.state=="Bereit" && EtaState_Switch.state==ON){
       executeCommandLine("/etc/openhab2/scripts/etastop.sh")
       EtaState_Switch.sendCommand(OFF) }
end

I’m asking as my rules do not work anymore…read about @rlkoshak 's summary on issues with exec but nothing helped. only i tried not to make openhab a su. but my scripts work also in shell without any root rights.

Thanks a lot. Norbert

Any Error Message in Log?

sudo chown openhab:openhab /etc/openhab2/scripts/*.sh
sudo chmod +x /etc/openhab2/scripts/*.sh

These two commands should be enough…

Did you add a timeout to the executeCommandLine and print the results from the attempt to run your scripts? That is the first suggestion on the solving exec problems paying and is least to figuring out why the script fails.

Thanks,

file permissions looked this way:

-rwxr-xr-x 1 openhab openhab 758 Aug 22 23:00 etahv.sh
-rwxr-xr-x 1 openhab openhab 282 Nov 17 23:02 etastart.sh
-rwxr-xr-x 1 openhab openhab 890 Nov 17 23:03 etastop.sh
-rwxr-xr-x 1 openhab openhab 193 Feb 21 2015 radio_off.sh
-rwxr-xr-x 1 openhab openhab 480 Feb 21 2015 radio_on.sh
-rw-rw-r-- 1 openhab openhab 235 Sep 30 17:59 readme.txt
-rwxr-xr-x 1 openhab openhab 632 Aug 22 23:01 repcheck.sh

so, guess that chown and chmod would not change anything as its already set.but thanks for trying!

Rich, will change and look for the log result. but again my question…does exec 2.2 support still the old structure as above or anyway it would not work (despite to permissions,…) and i have to change to thing/channel structure.

Thanks Norbert

executeCommandLine is a default Action and should not be confused with the Exec binding. As far as I know it is the exact same code as executeCommandLine in 1.8.

ah, did not know. thanks…

Changed now the rule so i can see the log reply. but not much information…not sure what the NULL means exactly.

2017-11-19 23:25:08.835 [INFO ] [lipse.smarthome.io.net.exec.ExecUtil] - executed commandLine 'sudo /etc/openhab2/scripts/etastart.sh'
2017-11-19 23:25:08.845 [INFO ] [pse.smarthome.model.script.MyExecLog] - null