Skip to content

Commit 51cb546

Browse files
committed
Merge pull request #4577
0c3e101 Added systemd .service file in order to help distributions integrate bitcoind. (Aitor Pazos)
2 parents b45e782 + 0c3e101 commit 51cb546

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

contrib/systemd/bitcoind.service

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[Unit]
2+
Description=Bitcoin's distributed currency daemon
3+
After=network.target
4+
5+
[Service]
6+
User=bitcoind
7+
Group=bitcoind
8+
9+
Type=forking
10+
PIDFile=/var/lib/bitcoind/bitcoind.pid
11+
ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid -conf=/etc/bitcoind.conf -datadir=/var/lib/bitcoind
12+
13+
Restart=always
14+
PrivateTmp=true
15+
16+
[Install]
17+
WantedBy=multi-user.target

doc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ The Bitcoin repo's [root README](https://github.com/bitcoin/bitcoin/blob/master/
6868
- [Assets Attribution](assets-attribution.md)
6969
- [Files](files.md)
7070
- [Tor Support](tor.md)
71+
- [Systemd](systemd.md)
7172

7273
License
7374
---------------------

doc/systemd.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
SYSTEMD SUPPORT IN BITCOIN
2+
==========================
3+
4+
Packagers can find a .service file in this repo in order to integrate bitcoin's
5+
daemon into systemd based distributions.
6+
7+
bitcoind.service file is located in contrib/systemd/ folder.
8+
9+
1. Users
10+
---------------------------------
11+
12+
This .service file assumes bitcoind user and group exist in the system, so packager
13+
should make sure they are created on installation.
14+
15+
2. Files
16+
---------------------------------
17+
18+
The .service file assumes several paths that might need to be adjusted according
19+
to packager's needs.
20+
21+
Daemon's config file is assumed to be located at /etc/bitcoind.conf (you can
22+
use contrib/debian/examples/bitcoin.conf as an example). Once installed, users
23+
must edit the file in order to update at least these two
24+
values: rpcuser and rpcpassword . Failing to do so will make the daemon fail
25+
to boot. However, the message written to /var/lib/bitcoind/debug.log file is
26+
very helpful and no default values should be set:
27+
28+
YYYY-MM-DD HH:MM:DD Error: To use the "-server" option, you must set a rpcpassword in the configuration file:
29+
/etc/bitcoind.conf
30+
It is recommended you use the following random password:
31+
rpcuser=bitcoinrpc
32+
rpcpassword=HdYZ5HGtAF7mx8aTw6uCATtD2maMAK4E12Ysp4YNZQcX
33+
(you do not need to remember this password)
34+
The username and password MUST NOT be the same.
35+
If the file does not exist, create it with owner-readable-only file permissions.
36+
It is also recommended to set alertnotify so you are notified of problems;
37+
for example: alertnotify=echo %s | mail -s "Bitcoin Alert" [email protected]
38+
39+
Daemon's data and pid files will be stored in /var/lib/bitcoind directory, so it
40+
should be created on installation and make bitcoind user/group it's owner.
41+
42+
3. Installing .service file
43+
---------------------------------
44+
45+
Installing this .service file consists on just copying it to /usr/lib/systemd/system
46+
directory, followed by the command "systemctl daemon-reload" in order to update
47+
running systemd configuration.

0 commit comments

Comments
 (0)