Skip to content

Make ScopedProcessRunner hold the child until we register with systemd

The QProcess::processStarted signal is too late: that is emitted after the child process has execve'd the target executable. If that target exits or backgrounds too quickly, the PID we get from processId() may be stale. Hopefully it won't have got reused yet, but we get errors from systemd nonetheless. And in the case of a target that forks and backgrounds, the processes "escape" the confinement. This is seen with Chrome/Chromium, which means their processes end up in plasma-krunner.service and slice.

So, instead, we must hold the child process before execve() and we do that with an eventfd. Once systemd has replied to us, we release the child.

SystemdProcessRunner doesn't need this change.

Merge request reports