[Development] Deprecating the static QProcess::startDetached() overloads

Thiago Macieira thiago.macieira at intel.com
Wed Feb 27 21:22:05 CET 2019


On Wednesday, 27 February 2019 11:35:21 PST Oswald Buddenhagen wrote:
> it's unreasonable to risk tearing down "detached" children on process
> exit; that would be a totally fake api. also, you can't just pretend
> that the children aren't yours, because you need to collect the zombies,
> so at best the QProcess frontend could detach from them.

Good point: so long as the parent process is still running, it MUST waitpid() 
on the child processes. So even if we make QProcess front-end abandon the 
child, the backend in forkfd must still know about it.

When the parent process exits, the children will be reparented to PID 1. But 
their controlling TTYs, process groups and session IDs will not change. We can 
assume you properly redirected std{in,out,err} away from the TTYs if you meant 
to detach, but we need to know whether to detach the controlling TTY too (if 
any), otherwise the process will get a SIGHUP when the TTY itself gets closed. 
As for PGRP and SID, I don't remember those Unix arcana details to predict 
what would happen.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products






More information about the Development mailing list