child_process.execFile slow to exit
Maybe it's waiting on input and timing out after 10s?
Try closing stdin with .end()
as mentioned in https://nodejs.org/api/child_process.html#child_process_subprocess_stdin
(in this usage, you'll need the original return value of execFile
, so don't promisify, as per https://stackoverflow.com/a/30883005/1105015)
e.g.
const util = require('util');const execFile = require('child_process').execFile;const process = execFile( 'PluginManager.exe', ['/install'], (e, stdout, stderr) => { if (e) { console.log(e); } else { console.log('done', stdout, stderr)); }});process.stdin.end();
Have you tried by adding the killSignal
option set to something a bit more aggresive?
const process = execFile('PluginManager.exe', ['/install'], {killSignal: 'SIGKILL'});