From ad3f25754d2f15663df9c6c5241c1693d295bc27 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/main.dev.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.dev.js b/app/main.dev.js index e2f4f46f6f7..0dd6cc409ce 100644 --- a/app/main.dev.js +++ b/app/main.dev.js @@ -257,7 +257,7 @@ app.on('ready', async () => { sendGrpcDisconnected() // Check to see if an LND process is running - 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) { throw new Error(err) }