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

home directory detection #216

Closed
femaref opened this issue Mar 25, 2019 · 3 comments
Closed

home directory detection #216

femaref opened this issue Mar 25, 2019 · 3 comments

Comments

@femaref
Copy link
Contributor

femaref commented Mar 25, 2019

postgres calls the archive/restore command with a very limited env, notably, $PATH and $HOME are missing. As such, the home dir detection of github.com/mitchellh/go-homedir fails, as it can't find getent.

There is a fix for that (mitchellh/go-homedir#18) but that's on in the v1.1.0 release.

Looking for the code, there are two other places where the homedir is used - internal/crypto.go and internal/config.go. Both use os/user.Current. Is there a reason why cmd/root.go uses the other way? Nonetheless, a workaround right now is to
use HOME=/path/to/dir /usr/bin/wal-g.

@x4m
Copy link
Collaborator

x4m commented Apr 23, 2019

Hi! Sorry for so long delay...
Yes, this go-home thing certainly is a problem: usages should be unified. And if we really need go-homedir, it should be in gopkg.toml?

@x4m
Copy link
Collaborator

x4m commented May 6, 2019

@femaref can you please send a PR with behavior that you think is optimal?
I mean to choose between go-homedir and os/user.Current?

@x4m
Copy link
Collaborator

x4m commented Jul 31, 2019

Should be fixed now, please reopen if this will reappear in 0.2.10

@x4m x4m closed this as completed Jul 31, 2019
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

2 participants