Example #1
0
    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);
    }
Example #2
0
function term() {
  treeKill(process.pid, 'SIGTERM', function(err) {
    if (err) {
      vscode.window.showErrorMessage(`Failed to kill process with PID ${process.pid}.`);
    } else {
      process = null;
    }
  });
}
Example #3
0
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');
    }
}
Example #4
0
export function deactivate() {
  if (process) {
    treeKill(process.pid, 'SIGTERM', function(err) {
      if (err) {
        treeKill(process.pid, 'SIGKILL');
      }
      process = null;
    });
  }
}
Example #5
0
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();
   });
 });
Example #7
0
 _processes.forEach(process => treeKill(process.pid, signal));
 const killForkedProcess = () => {
   if (forkedProcess && forkedProcess.pid) {
     treeKill(forkedProcess.pid, 'SIGTERM');
   }
 };
Example #9
0
 treeKill(process.pid, 'SIGTERM', function(err) {
   if (err) {
     treeKill(process.pid, 'SIGKILL');
   }
   process = null;
 });
Example #10
0
 new Promise((resolve) => kill(gotifyInstance.pid, 'SIGKILL', () => resolve())),