2011-04-12 39 views
0

我編寫nodejs函數來執行'nohup'命令並將成功結果作爲http響應發送。nodejs child_processes.exec無法返回'nohup'命令

function _nohup(cmd,res){ 
    var child = exec('nohup ./' + cmd + '.sh &', 
    function (error, stdout, stderr) { 
     res.writeHeader(200); 
     res.end("start process success!"); 
    }); 
} 

但是當我通過url地址調用函數時,響應數據無法返回。

回答