mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-06 19:23:41 +02:00
Merge #12255: Update bitcoin.service to conform to init.md
bad1716c6dinit: Modify docs and add release note for 12255 (Carl Dong)b0c7b54d0cinit: Use systemd automatic directory creation (Carl Dong) Pull request description: - `-datadir` option specified. - Ask systemd to create and set the right mode for PID directory, configuration directory, and data directory. - Tell systemd our group so it will set the right owner for aforementioned directories. More information: https://www.freedesktop.org/software/systemd/man/systemd.exec.html Tree-SHA512: a6fad1efa2be433c1fdd863df3ff232736ed709a9e281f51a003b40987d8c213dc64a52bc13a19c85bf85680e78f0be112ecaf32ac274b1ff93bac84a1208845
This commit is contained in:
@@ -5,21 +5,45 @@
|
||||
# See "man systemd.service" for details.
|
||||
|
||||
# Note that almost all daemon options could be specified in
|
||||
# /etc/bitcoin/bitcoin.conf
|
||||
# /etc/bitcoin/bitcoin.conf, except for those explicitly specified as arguments
|
||||
# in ExecStart=
|
||||
|
||||
[Unit]
|
||||
Description=Bitcoin daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/bitcoind -daemon -conf=/etc/bitcoin/bitcoin.conf -pid=/run/bitcoind/bitcoind.pid
|
||||
# Creates /run/bitcoind owned by bitcoin
|
||||
RuntimeDirectory=bitcoind
|
||||
User=bitcoin
|
||||
ExecStart=/usr/bin/bitcoind -daemon \
|
||||
-pid=/run/bitcoind/bitcoind.pid \
|
||||
-conf=/etc/bitcoin/bitcoin.conf \
|
||||
-datadir=/var/lib/bitcoind
|
||||
|
||||
# Process management
|
||||
####################
|
||||
|
||||
Type=forking
|
||||
PIDFile=/run/bitcoind/bitcoind.pid
|
||||
Restart=on-failure
|
||||
|
||||
# Directory creation and permissions
|
||||
####################################
|
||||
|
||||
# Run as bitcoin:bitcoin
|
||||
User=bitcoin
|
||||
Group=bitcoin
|
||||
|
||||
# /run/bitcoind
|
||||
RuntimeDirectory=bitcoind
|
||||
RuntimeDirectoryMode=0710
|
||||
|
||||
# /etc/bitcoin
|
||||
ConfigurationDirectory=bitcoin
|
||||
ConfigurationDirectoryMode=0710
|
||||
|
||||
# /var/lib/bitcoind
|
||||
StateDirectory=bitcoind
|
||||
StateDirectoryMode=0710
|
||||
|
||||
# Hardening measures
|
||||
####################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user