From 90236daca91afd7503846d40d68b9aa332ea4cd8 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Sun, 24 Dec 2017 14:52:41 -0600 Subject: [PATCH] fix(lnd-detection): Lookup lnd using explicit output specifiers `ps x -o pid,command` rather than `ps lx` The default ps-node lookup is via ps lx, which includes: -l Display information associated with the following keywords: uid, pid, ppid, flags, cpu, pri, nice, vsz=SZ, rss, wchan, state=S, paddr=ADDR, tty, time, and command=CMD. On mac, the `ps l` output can be misaligned, e.g. when some VSZ field is longer than expected. Many of these fields are unnecessary because we're looking up by name only, so we can lookup using only the command fields of ps. https://gist.github.com/ivankovacevic/9918272 More on the issue with ps-node: https://github.com/neekey/table-parser/issues/11 https://github.com/neekey/ps/pull/64 --- app/lib/lnd/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/lnd/util.js b/app/lib/lnd/util.js index 0656abddeb5..01165ea4260 100644 --- a/app/lib/lnd/util.js +++ b/app/lib/lnd/util.js @@ -187,7 +187,7 @@ export const createMacaroonCreds = async macaroonPath => { export const isLndRunning = () => { return new Promise((resolve, reject) => { mainLog.info('Looking for existing lnd process') - lookup({ command: 'lnd' }, (err, results) => { + lookup({ command: 'lnd', psargs: 'x -o pid,command' }, (err, results) => { // There was an error checking for the LND process. if (err) { return reject(err)