I tried to start an external process (I named it: PEX) from another Qt (version 3.x) application (I named it: PGUI). The PGUI runs 24/7/365 and the process PEX needs to be ran as long as the PGUI is running. In PGUI, I use the start() of QProcess to start the PEX.

The PGUI also can kill (kill()) the PEX and re-start PEX many times at the beginning when the PGUI start to run. It works as designed. But, after a few days (or a few hours, it varied,) the PEX stops working. (the PEX is still in the process list.) Then, I stop the PEX by using QProcess kill(), sometimes the PEX can be out of process list, sometimes not. (at this moment, the only way I can get rid of the process is manually remove it by using shell command "kill" or "kill -kill") It seems that the PGUI loses the control of the PEX. That is the first problem. The kill() of the QProcess does not work all the time.

The second problem is, then, the PGUI can no longer start another PEX (the PEX is designed to run multiple instance). I use processIdentifier() to retrieve the PID, and, as expected, the PID is -1.

Can anyone help to solve the problems?

Thanks