Skip to content

Commit

Permalink
Enable coredumping
Browse files Browse the repository at this point in the history
  • Loading branch information
Seshpenguin committed Feb 15, 2023
1 parent f0d0ed0 commit 8d15fa7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/modules/plasma-mobile-nightly/index.ts
Expand Up @@ -17,6 +17,18 @@ export async function loadPlasmaMobileNightlyModule() {
}).join('\n')
);
}

// Enable core dumps
await runCmd("/bin/sh", ["-c", "echo '/tmp/core.%e.%p' | tee /proc/sys/kernel/core_pattern"]);
let profile = fs.readFileSync("/home/user/.profile", "utf8");
if (!profile.includes("ulimit -c unlimited")) {
fs.appendFileSync("/home/user/.profile", "ulimit -c unlimited");
}
let limits = fs.readFileSync("/etc/security/limits.conf", "utf8");
if (!limits.includes("core unlimited")) {
fs.appendFileSync("/etc/security/limits.conf", "* soft core unlimited\n* hard core unlimited");
}

} catch(e) {
log.error("Failed to load Plasma Mobile Nightly module: " + e);
}
Expand Down

0 comments on commit 8d15fa7

Please sign in to comment.