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

Switch to Common APPDATA directory on Windows #49

Open
davecgh opened this issue Nov 26, 2013 · 2 comments
Open

Switch to Common APPDATA directory on Windows #49

davecgh opened this issue Nov 26, 2013 · 2 comments

Comments

@davecgh
Copy link
Member

davecgh commented Nov 26, 2013

Currently, btcd uses %LOCALAPPDATA% for the application data directory. This means when btcd runs, the chain data, config file, logs, etc all go to a separate directory depending on the user it is running as.

The intent is for btcd to share this information, so saving this information on a per-user basis is not desirable.

This becomes particularly apparent with the recent addition of the Windows service code where the data goes to the service account when running as a service, but to the user's account when running as a user.

@justusranvier
Copy link
Contributor

Will it be supported on Linux to run btcd in daemon mode as its own user, and then allow the gui to started as a different user(s)?

In that case, for full FHS compliance the config file should be /etc/btcd.conf and the other files should be in the appropriate subdirectories of /var (/var/lib/btcd, /var/tmp/btcd, perhaps also /var/cache/btcd)

http://www.pathname.com/fhs/pub/fhs-2.3.html#THEVARHIERARCHY

@davecgh
Copy link
Member Author

davecgh commented Dec 15, 2013

The idea for btcd to run as a daemon on Linux/Unix is to use either the system tools or one of the myriad applications that already exist for daemonizing applications. Some examples are upstart, systemd, launchd, daemontools, supervisord, and runit.

The reason for this is a Go program can't daemonize itself like a C/C++ program due to threads. By the time main is called in a Go program, it is already multi-threaded, so it's too late to daemonize. There is a growing school of thought that programs daemonizing themselves isn't necessarily a good idea anyways and it seems Go prescribes to this line of thinking.

FHS compliance is a good thing, but I suspect there will need to be some way to configure it since not all *nix OSes follow it.

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

No branches or pull requests

2 participants