Don't know if this is a feature or is as intended.
Issue for ppid: 1, you get all parent processes that have the digit: "1" in them, eg: processes with ppid "12345" are selected as well.
ps.lookup({
command: 'cmd',
ppid: 1
}, function(err, res) {
if(err) {
console.log(err);
}
// more code ...
});
WORKAROUND: you can use a regex: ppid: "^1$" to get exact matches:
ps.lookup({
command: 'cmd',
ppid: "^1$"
}, function(err, res) {
if(err) {
console.log(err);
}
// more code ...
});
Thanks!