EXEC binding stops working after a while: Is it possible to set a timeout?

I’ve added to my working OpenHAB installation an item that records the temperature measured by the Broadlink eAIR sensor.
It works through a python script that is executed with the EXEC binding.
For some reasons that I do not know, the EXEC binding stops working after a while: all items that are read through the EXEC binding are not updated anymore.
I suspect that once the script that reads the eAIR sensors hangs, then the EXEC binding keeps waiting forever and stops all subsequent actions. Unfortunately there is no sign of error in the openhab.log file. The only trace of this malfunction is the fact that in the events.log the items do not appear anymore.
Once the EXEC binding is stuck the only way to make it restart is to restart openhab completely.
Is it possible to define a timeout (either in the binding or in the shell script)?

Here are some more details.

Number TempeAIR "Temp [%.1f °C]" <temperature> (Temp) {exec="<[/bin/sh /home/pi/GetTemp:60000:JS(Extract-Temp.js)]"}

the GetTemp script is as follows

python /home/pi/python/broadlink/davorf/BlackBeanControl1.py -s temperature  -p 80 -i -m B4:43:

Note that when the EXEC binding is stuck, i.e.when the items are not updated, if I execute the GetTemp script from the command line I obtain a response.

Do you have any suggestions?
Thank you,
Lionello Marrelli

I have found that in linux it is possible to use the timeout command


I’ve just implemented and will see if it works

I am encountering similar behavior with my EXEC binding which for me calls a shell script to ssh to another machine and execute some commands. I was wondering how you made out with the timeout?

I was thinking of implementing a 15 min restart of the openhab service for now until i can get better solution.

syntax for exec binding:

Thing exec:command:uniquename [command="/command/to/execute here", interval=15, timeout=5, autorun=false]

from docs
timeout - A time-out, in seconds, the execution of the command will time out, and lastly,