Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app searches ledger binary strictly at /usr/bin/ledger #5

Closed
ignis32 opened this issue Mar 5, 2016 · 1 comment
Closed

app searches ledger binary strictly at /usr/bin/ledger #5

ignis32 opened this issue Mar 5, 2016 · 1 comment

Comments

@ignis32
Copy link

ignis32 commented Mar 5, 2016

Conditions:

Ubuntu-14.04-x86_64.
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

ledger binary was installed at /usr/bin/ledger.

App returns "execvp(): No such file or directory\n" on "/version" request.

Strace shows the following:

[pid 13200] execve("/usr/local/bin/ledger", ["/usr/local/bin/ledger", "--version"], [/* 21 vars */]) = -1 ENOENT (No such file or directory)
[pid 13200] write(19, "\2\0\0\0", 4 <unfinished ...>

App does not try any other locations for the ledger binary

ln -s /usr/bin/ledger /usr/local/bin/ledger fixes the problem fore me,

but I think that it would be nice if app could find the binary using PATH without this workaround.

Cheers!

@slashdotdash
Copy link
Owner

@ignis32 You can provide the path to the Ledger binary as a configuration option to LedgerRest.

The config object is passed through to the ledger-cli library.

var LedgerRest = require('ledger-rest').LedgerRest;

var server = new LedgerRest({ 
  binary: '/usr/local/bin/ledger',
  file: 'path/to/ledger/journal/file.dat'
});

I have no plans to add support for using the PATH variable, but am happy to accept a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@slashdotdash @ignis32 and others