-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
Bitcoind as system background service #4124
Comments
Yes, we need this. It would also mean the blockchain database can become shared and system-wide, and be stored in /var/lib/bitcoin or something, instead of in home directories (which seems frowned upon, for such amounts of data). |
Yes, sounds like a good plan. As we don't have to worry about the wallet here, everything can be public and shared. |
@Drak You do realize that calling something 'trivial' is the same as volunteering to implement it? |
I've just introduced this to Alpine Linux. The bitcoin daemon runs under /var/lib/bitcoin as bitcoin:bitcoin using /etc/bitcoin.conf for configuration. The post install script generates a random user / pass / port for a new installation. The init script also enforces sensible permissions. Via LXC 1.00+ it is possible to run an unprivileged Alpine container on any Linux (size 5mb) Same is possible for namecoin |
Hopefully you did not do what the debian package did at one point and use a non-cryptographic PRNG to pick those keys, making it trivial to guess the rpc credentials? |
do you consider /dev/urandom strong enough ? |
Sure, but its how you use it that counts. Link me to the code and I'll review it. |
It's the 2nd from last addition at http://lists.alpinelinux.org/alpine-devel/3710.html User is 32 char & Pass is 64 char |
@itoffshore Cool. Characters which need to be escaped in URLs break some applications, I'd recommend leaving out the symbols. The ones Bitcoin itself generates are just a base58 encoded 256-bit value. (I believe I've seen % and & both cause problems, ! is sometimes annoying if specifying the strings on the command line). Looks fine generally, the lack of error handling (e.g. /dev/urandom couldn't be opened, or something doesn't support the -c extension to head) might be concerning but bitcoin won't let you run with a too short rpcpassword. Sorry for the diversion. :) |
|
The system service would concern a wallet-less build, so generating a safe rpcuser/pass is not of critical importance (and given that RPC listens on localhost only...). |
@Drak have you got it working? I've tried registering as a windows service via sc. exe create but no luck. |
Alpine Linux has packages now for Bitcoin / Namecoin with both running as a service as Bitcoin / Namecoin user:groups. There are templates in LXC for Alpine (a running Alpine container is 5 meg in size) so it is simple to run Bitcoin on any Linux (or as a virtualbox service in Windows). |
There is also a PR with Upstart and OpenRC support #4611 |
Back-ported some files from BitCoin core (approved) PR’s with some additions for Master Core. See: bitcoin#4124 bitcoin#4611
This (and PR #4611) is some nice work. Is there any (official) effort to make an Ubuntu (or other distro) package that includes it? (Edit: I've seen the existing PPA repository and the current bitcoin package does not include any init scripts) |
On any Linux distribution install LXC (Ubuntu / Debian / Redhat / Archlinux / OpenSUSE have packages) & create an Alpine Linux container (this is 5 meg in size). Log in to the container (user = root & password is empty) & run:
& bitcoin will run as user bitcoin. There is also a package for namecoin in Alpine. For extra security & complete isolation run an unprivileged container. |
Nice work. Would love to see a package for Litecoin too. |
This is sufficiently done now ( |
What about running it as a service on Microsoft Windows? This doesn't seem to have been addressed. |
We don't have any active windows developers, so none of us will do that. But feel free to write a guide on that. |
When using bitcoind as a wallet-less full node, it would be useful to be able to run it as a system service, so that it starts automatically at startup and can be controlled though the OS's normal service start and stop functionality.
For the Debian/Ubuntu side of things see hippich and fungus' posts here: https://bitcointalk.org/?topic=965.0 . It'd make most sense to integrate this into the PPA. There are two different systems in use here: old-style sysv init scripts, and upstart.
For Windows/OSX I'm not sure what is necessary. At least we'd need new installer packages, separate from the normal "Bitcoin Core Wallet" which provide a node and nothing more.
The installer would also need to create user credentials to run under.
Edit: for the service install, this would also imply moving the configuration to a system-wide instead of user location, for example
/etc/bitcoin.conf
as well as default the data directory to a system-scope location (probably/var/lib/bitcoin
).The text was updated successfully, but these errors were encountered: