diff --git a/src/lib/gui/core/CoreProcess.cpp b/src/lib/gui/core/CoreProcess.cpp index a52127573..1e7a7a2ad 100644 --- a/src/lib/gui/core/CoreProcess.cpp +++ b/src/lib/gui/core/CoreProcess.cpp @@ -14,6 +14,11 @@ #include "OSXHelpers.h" #endif +#ifdef Q_OS_LINUX +#include +#include +#endif + #include #include #include @@ -203,6 +208,14 @@ void CoreProcess::startForegroundProcess(const QStringList &args) const auto quoted = makeQuotedArgs(m_appPath, args); qInfo("running command: %s", qPrintable(quoted)); +#ifdef Q_OS_LINUX + m_process->setChildProcessModifier([] { + // the core process becomes orphaned when the gui process exits abruptly (e.g. with kill -9), + // so ensure the os also kills the core when that happens to the gui. + prctl(PR_SET_PDEATHSIG, SIGTERM); + }); +#endif + m_process->start(m_appPath, args); if (m_process->waitForStarted()) {