How Can I Run a Script That Won't Terminate With Qt App?
Solved
Mobile and Embedded
-
Hello everyone,
I am basically trying to run a script that will change my running application with another version.
In OS, my app runs as a service called "myapp". My basic script,
/update.sh
#!/bin/sh sudo service myapp stop #killing my application sleep(3) #waiting for the finish rm my_app #removing old executable cp update/my_app . #copying new app to the main dir sudo service myapp start #starting it again
In Qt, I am calling the script to run, like that,
QProcess::execute("./update/update.sh");
But as it reaches the 3rd line of the script (
sudo service myapp stop
),
the script terminates with the application, and nothing is being updated.How can I run it so it won't terminate?
Maybe running in a new shell? But how? -
-
@closx said in How Can I Run a Script That Won't Terminate With Qt App?:
That worked.
Great. Please mark your post as solved! Thanks.