The program processA
is a Linux service, launched by "systemctl start processA
".
This process will call std::system
to run a shell script to upgrade software.
The script will run "systemctl
" to stop processA
first, then replace some executable files, finally restart processA
.
The problem is that when "systemctl stop processA
" is executed, the script is also terminated.
How to solve it?
I had tried to run the script file in terminal; it works. So there is not a problem with the script.
//this is how the script is called
int rs = std::system("/usr/bin/update_server.sh upgrade \"/tmp/firmware\" > \"/tmp/upgrade.log\" 2>&1");