From 6f39fd026e1833479ae7f9fb625486b59e534113 Mon Sep 17 00:00:00 2001 From: Luca Milanesio Date: Wed, 25 Feb 2015 15:43:54 +0000 Subject: [PATCH] Added extra logs when child PIDs start/end --- app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.js b/app.js index 3023a5f..87732fe 100644 --- a/app.js +++ b/app.js @@ -8,7 +8,9 @@ var fs = require('fs'); var waitpid = require('waitpid'); process.on('SIGCHLD', function(args){ + console.error((new Date()) + " Got SIGCHLD: waiting for child process to terminate ... ") waitpid(-1); + console.error((new Date()) + " Child processed ended") }); var opts = require('optimist') @@ -129,11 +131,15 @@ wss.on('request', function(request) { rows: 30 }); } + console.log((new Date()) + " PID=" + term.pid + " STARTED on behalf of user=" + sshuser) term.on('data', function(data) { conn.send(JSON.stringify({ data: data })); }); + term.on('exit', function(code) { + console.log((new Date()) + " PID=" + term.pid + " ENDED") + }) } if (!data) return;