Skip to content

Commit

Permalink
fix(lnd-detection): Lookup lnd using explicit output specifiers
Browse files Browse the repository at this point in the history
`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:
neekey/table-parser#11
neekey/ps#64
  • Loading branch information
Empact committed Mar 17, 2018
1 parent d511b65 commit ad3f257
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand Down

0 comments on commit ad3f257

Please sign in to comment.