os.execute in background?  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

os.execute in background?

Post by Number8 »

As suggested in this post https://www.domoticz.com/forum/viewtopi ... 59&t=31447, I have a dzvents scripts that kicks a bash script (os.execute) that will at a certain point in time trigger a custom event. Everything is working as expected. However, I'm under the impression that os.execute does not start in background. Am I right? I could very well kick the bash script using cron. However, for maintenability reasons, I prefer to have all in one place. So my question: is there a mean to kick os.execute asynchronously?
Lets put it put another way. Since the bash script is used because I need to send a cookie, is the cookie mechanism will be some day supported directly in dzvents (openURL)

Thank you
Debian buster on NUC and three RPi with buster.
User avatar
heggink
Posts: 989
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: os.execute in background?  [Solved]

Post by heggink »

By default, os.execute is a blocking call. Add an & at the end of the command line to run in background. I do that on all calls to prevent these 'seems to have ended' messages in the log.

Sent from phone.

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: os.execute in background?

Post by Number8 »

Perfect, thank you
Debian buster on NUC and three RPi with buster.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest