Closed peteroreil closed 7 years ago
Found on version 0.1.4 /lib/index.js Line 74
0.1.4
/lib/index.js Line 74
If a process is started with a particularly long argument/ multiple arguments,
e.g.node /really/long/absolute/path/to/my/script/myscriptname.js
node /really/long/absolute/path/to/my/script/myscriptname.js
The object returned ps.lookup for that process will return a truncated version of the argument passed to the script e.g. /really/long/absolute/pa
/really/long/absolute/pa
` else { ChildProcess.exec('ps ' + args, function (err, stdout, stderr) {
if (err || stderr) { return callback(err || stderr.toString()); } else { stdout = stdout.toString(); callback(null, stdout || false); } });`
Function that is causing the problem is the ChildProcess.exec. Suggested solutions are to change from exec to spawn?
http://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html
Minor workaround is is to pass an option of{ psargs: " " } to the lookup function to limit the size of stdout returned
{ psargs: " " }
@peteroreil this is a known issue for 0.1.4 you can switch to 0.1.5 for the moment, or wait for a few days I will release 0.1.6 soon which fixes a small issue brought in 0.1.5 for kill()
0.1.5
0.1.6
kill()
Found on version
0.1.4
/lib/index.js Line 74
If a process is started with a particularly long argument/ multiple arguments,
e.g.
node /really/long/absolute/path/to/my/script/myscriptname.js
The object returned ps.lookup for that process will return a truncated version of the argument passed to the script e.g.
/really/long/absolute/pa
` else { ChildProcess.exec('ps ' + args, function (err, stdout, stderr) {
Function that is causing the problem is the ChildProcess.exec. Suggested solutions are to change from exec to spawn?
http://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html
Minor workaround is is to pass an option of
{ psargs: " " }
to the lookup function to limit the size of stdout returned