Skip to content

Commit 6f39fd0

Browse files
committed
Added extra logs when child PIDs start/end
1 parent da3a0d1 commit 6f39fd0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ var fs = require('fs');
88
var waitpid = require('waitpid');
99

1010
process.on('SIGCHLD', function(args){
11+
console.error((new Date()) + " Got SIGCHLD: waiting for child process to terminate ... ")
1112
waitpid(-1);
13+
console.error((new Date()) + " Child processed ended")
1214
});
1315

1416
var opts = require('optimist')
@@ -129,11 +131,15 @@ wss.on('request', function(request) {
129131
rows: 30
130132
});
131133
}
134+
console.log((new Date()) + " PID=" + term.pid + " STARTED on behalf of user=" + sshuser)
132135
term.on('data', function(data) {
133136
conn.send(JSON.stringify({
134137
data: data
135138
}));
136139
});
140+
term.on('exit', function(code) {
141+
console.log((new Date()) + " PID=" + term.pid + " ENDED")
142+
})
137143
}
138144
if (!data)
139145
return;

0 commit comments

Comments
 (0)