aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-07-30 10:08:36 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-07-30 10:08:43 +0200
commit51cb5468862fb7f6d9ac2ae3a1bdb48a8b339ff7 (patch)
treeee7d934a200ebc909b8281cedee86702070cf596
parentb45e782071c1aa86495feac88c5e75f995fe3b45 (diff)
parent0c3e1019665edb6c456f9640307231863db2835f (diff)
Merge pull request #4577
0c3e101 Added systemd .service file in order to help distributions integrate bitcoind. (Aitor Pazos)
-rw-r--r--contrib/systemd/bitcoind.service17
-rw-r--r--doc/README.md1
-rw-r--r--doc/systemd.md47
3 files changed, 65 insertions, 0 deletions
diff --git a/contrib/systemd/bitcoind.service b/contrib/systemd/bitcoind.service
new file mode 100644
index 0000000000..edc81cc763
--- /dev/null
+++ b/contrib/systemd/bitcoind.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Bitcoin's distributed currency daemon
+After=network.target
+
+[Service]
+User=bitcoind
+Group=bitcoind
+
+Type=forking
+PIDFile=/var/lib/bitcoind/bitcoind.pid
+ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid -conf=/etc/bitcoind.conf -datadir=/var/lib/bitcoind
+
+Restart=always
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/doc/README.md b/doc/README.md
index 924f5a8a69..f8bb8020d4 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -68,6 +68,7 @@ The Bitcoin repo's [root README](https://github.com/bitcoin/bitcoin/blob/master/
- [Assets Attribution](assets-attribution.md)
- [Files](files.md)
- [Tor Support](tor.md)
+- [Systemd](systemd.md)
License
---------------------
diff --git a/doc/systemd.md b/doc/systemd.md
new file mode 100644
index 0000000000..96202c1532
--- /dev/null
+++ b/doc/systemd.md
@@ -0,0 +1,47 @@
+SYSTEMD SUPPORT IN BITCOIN
+==========================
+
+Packagers can find a .service file in this repo in order to integrate bitcoin's
+daemon into systemd based distributions.
+
+bitcoind.service file is located in contrib/systemd/ folder.
+
+1. Users
+---------------------------------
+
+This .service file assumes bitcoind user and group exist in the system, so packager
+should make sure they are created on installation.
+
+2. Files
+---------------------------------
+
+The .service file assumes several paths that might need to be adjusted according
+to packager's needs.
+
+Daemon's config file is assumed to be located at /etc/bitcoind.conf (you can
+use contrib/debian/examples/bitcoin.conf as an example). Once installed, users
+must edit the file in order to update at least these two
+values: rpcuser and rpcpassword . Failing to do so will make the daemon fail
+to boot. However, the message written to /var/lib/bitcoind/debug.log file is
+very helpful and no default values should be set:
+
+ YYYY-MM-DD HH:MM:DD Error: To use the "-server" option, you must set a rpcpassword in the configuration file:
+ /etc/bitcoind.conf
+ It is recommended you use the following random password:
+ rpcuser=bitcoinrpc
+ rpcpassword=HdYZ5HGtAF7mx8aTw6uCATtD2maMAK4E12Ysp4YNZQcX
+ (you do not need to remember this password)
+ The username and password MUST NOT be the same.
+ If the file does not exist, create it with owner-readable-only file permissions.
+ It is also recommended to set alertnotify so you are notified of problems;
+ for example: alertnotify=echo %s | mail -s "Bitcoin Alert" admin@foo.com
+
+Daemon's data and pid files will be stored in /var/lib/bitcoind directory, so it
+should be created on installation and make bitcoind user/group it's owner.
+
+3. Installing .service file
+---------------------------------
+
+Installing this .service file consists on just copying it to /usr/lib/systemd/system
+directory, followed by the command "systemctl daemon-reload" in order to update
+running systemd configuration.