aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2019-08-29 11:40:10 +0800
committerfanquake <fanquake@gmail.com>2019-08-29 11:55:03 +0800
commitfc5b756bae26db5e88bd6ed15e2eb45b05e76bdd (patch)
tree4cbf8643ebfd8c0468eaed22038ad7ccaaa73581 /contrib
parent9546a785953b7f61a3a50e2175283cbf30bc2151 (diff)
parentf3b57f4a1c17aadbf02d408e980490c88838c6ba (diff)
downloadbitcoin-fc5b756bae26db5e88bd6ed15e2eb45b05e76bdd.tar.xz
Merge #16556: Fix systemd service file configuration directory setup
f3b57f4a1c17aadbf02d408e980490c88838c6ba Unrecommend making config file owned by bitcoin (setpill) 870d4152dfc3d990e336723562948835c2dbd646 Set ProtectHome in systemd service file (setpill) 639a416e3758b3005b860b198f0ec7bdd80a7f0c Chgrp config dir to bitcoin in systemd service (setpill) aded0528f0e1e3735ce8dd26fd9e546150b73187 Improve clarity of systemd service file comments (setpill) Pull request description: Rationale: ran into a bug with the systemd service file, fixed it locally and figured I might as well contribute my fix. Also fixed some unrelated confusing phrasing in the comments of the same file, after discussion in IRC. ACKs for top commit: sipsorcery: tACK f3b57f4a1c17aadbf02d408e980490c88838c6ba (nothing changed since previous tACK). ryanofsky: utACK f3b57f4a1c17aadbf02d408e980490c88838c6ba. Only change since last review is removing ConfigurationDirectoryMode churn in early commits Tree-SHA512: 2188345878925b9e8a5c2c3df8dfba443720e2252a164db54a8e1d8007846721497b2d98c56f1d9b60a9a9ed4fdb1156c7b02c699616b220a9b614671617d32a
Diffstat (limited to 'contrib')
-rw-r--r--contrib/init/bitcoind.service12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/init/bitcoind.service b/contrib/init/bitcoind.service
index cfc5f77580..34c3e7b3ab 100644
--- a/contrib/init/bitcoind.service
+++ b/contrib/init/bitcoind.service
@@ -5,8 +5,9 @@
# See "man systemd.service" for details.
# Note that almost all daemon options could be specified in
-# /etc/bitcoin/bitcoin.conf, except for those explicitly specified as arguments
-# in ExecStart=
+# /etc/bitcoin/bitcoin.conf, but keep in mind those explicitly
+# specified as arguments in ExecStart= will override those in the
+# config file.
[Unit]
Description=Bitcoin daemon
@@ -18,6 +19,10 @@ ExecStart=/usr/bin/bitcoind -daemon \
-conf=/etc/bitcoin/bitcoin.conf \
-datadir=/var/lib/bitcoind
+# Make sure the config directory is readable by the service user
+PermissionsStartOnly=true
+ExecStartPre=/bin/chgrp bitcoin /etc/bitcoin
+
# Process management
####################
@@ -53,6 +58,9 @@ PrivateTmp=true
# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full
+# Deny access to /home, /root and /run/user
+ProtectHome=true
+
# Disallow the process and all of its children to gain
# new privileges through execve().
NoNewPrivileges=true