Skip to content

Commit 331352f

Browse files
committed
Merge #10529: Improve bitcoind systemd service file
16be7dd Improve bitcoind systemd service file (Florian Schmaus) Pull request description: Add comment how further options can be added or existing ones modified. Use /run/${RuntimeDirectory} for PID file. Remove TimeoutStopSec, TimeoutStartSec, StartLimitInterval, StartLimitBurst directives as those should be set indivdually. Remove Group to user the bitcoin user's default group. Changed Restart from 'always' to 'on-failure' (can also be overwritten individually). Tree-SHA512: f76674c11fd6e3faaf786aa05686926523d9c875aad6b776337f800108fdb716470286805c532b494f8cf713cb5eea6b735e1c7c238ffb407a5cc909dda41aa4
2 parents 0dec4cc + 16be7dd commit 331352f

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

contrib/init/bitcoind.service

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1+
# It is not recommended to modify this file in-place, because it will
2+
# be overwritten during package upgrades. If you want to add further
3+
# options or overwrite existing ones then use
4+
# $ systemctl edit bitcoind.service
5+
# See "man systemd.service" for details.
6+
7+
# Note that almost all daemon options could be specified in
8+
# /etc/bitcoin/bitcoin.conf
9+
110
[Unit]
2-
Description=Bitcoin's distributed currency daemon
11+
Description=Bitcoin daemon
312
After=network.target
413

514
[Service]
15+
ExecStart=/usr/bin/bitcoind -daemon -conf=/etc/bitcoin/bitcoin.conf -pid=/run/bitcoind/bitcoind.pid
16+
# Creates /run/bitcoind owned by bitcoin
17+
RuntimeDirectory=bitcoind
618
User=bitcoin
7-
Group=bitcoin
8-
919
Type=forking
10-
PIDFile=/var/lib/bitcoind/bitcoind.pid
11-
ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid \
12-
-conf=/etc/bitcoin/bitcoin.conf -datadir=/var/lib/bitcoind -disablewallet
13-
14-
Restart=always
20+
PIDFile=/run/bitcoind/bitcoind.pid
21+
Restart=on-failure
1522
PrivateTmp=true
16-
TimeoutStopSec=60s
17-
TimeoutStartSec=2s
18-
StartLimitInterval=120s
19-
StartLimitBurst=5
2023

2124
[Install]
2225
WantedBy=multi-user.target

0 commit comments

Comments
 (0)