Killing child process in CEP node.js
Dear ppro fellows,
I have a strange behavior of child process in node js,
1. First I start it (in my custom invisible panel) setting it as a global var:
const exec1 = require('child_process').exec;
var exec1_obj = exec1(mypath_to_exe, function(err, stdout, stderr) {alert(err);});Then I listen to a specific event:
csInterface.addEventListener("com.adobe.csxs.events.ExtensionUnloaded", function(evt){
alert(evt.data);
exec1_obj.kill();
alert("Closed app");
});Now, after the event triggered I get alert with evt.data and I also get alert "Closed app". But my process (my exe file which generates my custom UI) survives this!
However, if I kill the same process on the spot like this:
const exec1 = require('child_process').exec;
var exec1_obj = exec1('"'+new_path+'"', function(err, stdout, stderr) {alert(err);});
exec1_obj.kill();it does gets killed immediately.
How can this be?
What do I miss here?
Yaroslav.
