Page 1 of 1

os.execute in background?

Posted: Thursday 07 May 2020 8:29
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

Re: os.execute in background?  [Solved]

Posted: Thursday 07 May 2020 8:39
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.


Re: os.execute in background?

Posted: Thursday 07 May 2020 10:12
by Number8
Perfect, thank you