public kill() { let treeKill = require("tree-kill"); treeKill(this.childProcess.pid, "SIGKILL"); const message = `Termination request was sent to process ${this.childProcess.pid} running command '${this.name}'.`; this.outputChannel.appendLine(message); }
function term() { treeKill(process.pid, 'SIGTERM', function(err) { if (err) { vscode.window.showErrorMessage(`Failed to kill process with PID ${process.pid}.`); } else { process = null; } }); }
export function terminate (pid) { const childCommand = childs.get(pid); if (childCommand.child) { outputChannel.appendLine(''); outputChannel.appendLine(`Killing process: ${childCommand.cmd} (pid:${pid})`); outputChannel.appendLine(''); kill(pid, 'SIGTERM'); } }
export function deactivate() { if (process) { treeKill(process.pid, 'SIGTERM', function(err) { if (err) { treeKill(process.pid, 'SIGKILL'); } process = null; }); } }
elc.app.on('before-quit', function(e: any) { contextMenuTemplate[0].label = 'Shutting down...' saveWinBounds() setTimeout(function() { elc.app.exit() }, 3000) // Hard limit - if it doesn't shut down in 3 seconds, we force kill it. const contextMenu = elc.Menu.buildFromTemplate(contextMenuTemplate) tray.setContextMenu(contextMenu) // console.log('before-quit: electron is quitting. ') globals.AppIsShuttingDown = true if (win !== null) { win.close() } e.preventDefault() globals.FrontendDaemon.on('exit', function() { console.log('Frontend has exited.') elc.app.exit() }) treekill(globals.FrontendDaemon.pid) metrics.SendRaw('App shut down') })
return new Promise((resolve, reject) => { kill(processId, 'SIGKILL', (err: any) => { err ? reject(err) : resolve(); }); });
_processes.forEach(process => treeKill(process.pid, signal));
const killForkedProcess = () => { if (forkedProcess && forkedProcess.pid) { treeKill(forkedProcess.pid, 'SIGTERM'); } };
treeKill(process.pid, 'SIGTERM', function(err) { if (err) { treeKill(process.pid, 'SIGKILL'); } process = null; });
new Promise((resolve) => kill(gotifyInstance.pid, 'SIGKILL', () => resolve())),