Skip to content

Commit 61a55b7

Browse files
committed
init: updated the most recent bitcoind.service file, following the last version on Bitcore Core project, and made the minor modifications required
1 parent 3bf5de2 commit 61a55b7

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

contrib/init/elementsd.service

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,53 @@
11
# It is not recommended to modify this file in-place, because it will
22
# be overwritten during package upgrades. If you want to add further
33
# options or overwrite existing ones then use
4-
# $ systemctl edit bitcoind.service
4+
# $ systemctl edit elementsd.service
55
# See "man systemd.service" for details.
66

77
# Note that almost all daemon options could be specified in
8-
# /etc/bitcoin/bitcoin.conf, except for those explicitly specified as arguments
9-
# in ExecStart=
8+
# /etc/elements/elements.conf, but keep in mind those explicitly
9+
# specified as arguments in ExecStart= will override those in the
10+
# config file.
1011

1112
[Unit]
12-
Description=Bitcoin daemon
13+
Description=Elements daemon
1314
After=network.target
1415

1516
[Service]
16-
ExecStart=/usr/bin/bitcoind -daemon \
17-
-pid=/run/bitcoind/bitcoind.pid \
18-
-conf=/etc/bitcoin/bitcoin.conf \
19-
-datadir=/var/lib/bitcoind
17+
ExecStart=/usr/bin/elementsd -daemon \
18+
-pid=/run/elementsd/elementsd.pid \
19+
-conf=/etc/elements/elements.conf \
20+
-datadir=/var/lib/elementsd \
21+
22+
# Make sure the config directory is readable by the service user
23+
PermissionsStartOnly=true
24+
ExecStartPre=/bin/chgrp elements /etc/elements
2025

2126
# Process management
2227
####################
2328

2429
Type=forking
25-
PIDFile=/run/bitcoind/bitcoind.pid
30+
PIDFile=/run/elementsd/elementsd.pid
2631
Restart=on-failure
32+
TimeoutStopSec=600
2733

2834
# Directory creation and permissions
2935
####################################
3036

31-
# Run as bitcoin:bitcoin
32-
User=bitcoin
33-
Group=bitcoin
37+
# Run as elements:elements
38+
User=elements
39+
Group=elements
3440

35-
# /run/bitcoind
36-
RuntimeDirectory=bitcoind
41+
# /run/elementsd
42+
RuntimeDirectory=elementsd
3743
RuntimeDirectoryMode=0710
3844

39-
# /etc/bitcoin
40-
ConfigurationDirectory=bitcoin
45+
# /etc/elements
46+
ConfigurationDirectory=elements
4147
ConfigurationDirectoryMode=0710
4248

43-
# /var/lib/bitcoind
44-
StateDirectory=bitcoind
49+
# /var/lib/elementsd
50+
StateDirectory=elementsd
4551
StateDirectoryMode=0710
4652

4753
# Hardening measures
@@ -53,6 +59,9 @@ PrivateTmp=true
5359
# Mount /usr, /boot/ and /etc read-only for the process.
5460
ProtectSystem=full
5561

62+
# Deny access to /home, /root and /run/user
63+
ProtectHome=true
64+
5665
# Disallow the process and all of its children to gain
5766
# new privileges through execve().
5867
NoNewPrivileges=true

0 commit comments

Comments
 (0)