Wie kann ich childprocess in nodejs beenden?

Erstellt einen childprocess mit shelljs

!/usr/bin/env node

require('/usr/local/lib/node_modules/shelljs/global');
   fs = require("fs");  
   var child=exec("sudo mongod &",{async:true,silent:true});

   function on_exit(){
        console.log('Process Exit');
        child.kill("SIGINT");
        process.exit(0)
    }

    process.on('SIGINT',on_exit);
    process.on('exit',on_exit);

Kind-Prozess läuft immer noch .. nach dem kill den parent-Prozess

InformationsquelleAutor der Frage Deepak Patil | 2013-11-25

Schreibe einen Kommentar