mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-28 04:49:49 -07:00
fix(app): keep AppImage mount alive until Chromium children finish shutdown
Background AppImage launches executed directly from a FUSE mount owned by a short-lived helper's AppImage runtime. On quit, the runtime unmounted the squashfs while utility children (network service) were still mid-shutdown, SIGBUSing them and triggering KDE Service Crash notifications on every video close. Detach a POSIX-sh supervisor instead: mount via --appimage-mount, run AppRun from the mount, and release the holder only once no process still executes from the mount. Falls back to the old direct launch on any failure or with SUBMINER_NO_APPIMAGE_MOUNT_KEEPALIVE=1.
This commit is contained in:
+13
-5
@@ -20,6 +20,7 @@ import {
|
||||
shouldHandleStatsDaemonCommandAtEntry,
|
||||
} from './main-entry-runtime';
|
||||
import { requestSingleInstanceLockEarly } from './main/early-single-instance';
|
||||
import { resolveAppImageMountKeepaliveInvocation } from './main/appimage-mount-keepalive';
|
||||
import { readConfiguredWindowsMpvLaunch } from './main-entry-launch-config';
|
||||
import { isAppControlServerAvailable, sendAppControlCommand } from './shared/app-control-client';
|
||||
import {
|
||||
@@ -289,11 +290,18 @@ async function runEntryProcess(): Promise<void> {
|
||||
|
||||
if (shouldDetachBackgroundLaunch(process.argv, process.env)) {
|
||||
const childArgs = hasTransportedStartupArgs(process.env) ? [] : process.argv.slice(1);
|
||||
const child = spawn(process.execPath, childArgs, {
|
||||
detached: true,
|
||||
stdio: 'ignore',
|
||||
env: sanitizeBackgroundEnv(process.env),
|
||||
});
|
||||
const keepalive = resolveAppImageMountKeepaliveInvocation(process.env);
|
||||
const child = keepalive
|
||||
? spawn(keepalive.command, [...keepalive.args, ...childArgs], {
|
||||
detached: true,
|
||||
stdio: 'ignore',
|
||||
env: sanitizeBackgroundEnv(process.env),
|
||||
})
|
||||
: spawn(process.execPath, childArgs, {
|
||||
detached: true,
|
||||
stdio: 'ignore',
|
||||
env: sanitizeBackgroundEnv(process.env),
|
||||
});
|
||||
child.unref();
|
||||
process.exit(0);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user