]> Git Repo - VerusCoin.git/blame - doc/init.md
test
[VerusCoin.git] / doc / init.md
CommitLineData
fb537854
NW
1*** Warning: This document has not been updated for Zcash and may be inaccurate. ***
2
234bfbf6
AW
3Sample init scripts and service configuration for bitcoind
4==========================================================
5
6Sample scripts and configuration files for systemd, Upstart and OpenRC
7can be found in the contrib/init folder.
8
41020ebe
W
9 contrib/init/bitcoind.service: systemd service unit configuration
10 contrib/init/bitcoind.openrc: OpenRC compatible SysV style init script
11 contrib/init/bitcoind.openrcconf: OpenRC conf.d file
12 contrib/init/bitcoind.conf: Upstart service configuration file
723664b5 13 contrib/init/bitcoind.init: CentOS compatible SysV style init script
234bfbf6
AW
14
151. Service User
16---------------------------------
17
18All three startup configurations assume the existence of a "bitcoin" user
19and group. They must be created before attempting to use these scripts.
20
212. Configuration
22---------------------------------
23
24At a bare minimum, bitcoind requires that the rpcpassword setting be set
25when running as a daemon. If the configuration file does not exist or this
26setting is not set, bitcoind will shutdown promptly after startup.
27
28This password does not have to be remembered or typed as it is mostly used
29as a fixed token that bitcoind and client programs read from the configuration
30file, however it is recommended that a strong and secure password be used
31as this password is security critical to securing the wallet should the
32wallet be enabled.
33
34If bitcoind is run with "-daemon" flag, and no rpcpassword is set, it will
35print a randomly generated suitable password to stderr. You can also
36generate one from the shell yourself like this:
37
38bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'
39
234bfbf6 40
4fbfebea 41For an example configuration file that describes the configuration settings,
234bfbf6
AW
42see contrib/debian/examples/bitcoin.conf.
43
443. Paths
45---------------------------------
46
47All three configurations assume several paths that might need to be adjusted.
48
49Binary: /usr/bin/bitcoind
50Configuration file: /etc/bitcoin/bitcoin.conf
51Data directory: /var/lib/bitcoind
52PID file: /var/run/bitcoind/bitcoind.pid (OpenRC and Upstart)
53 /var/lib/bitcoind/bitcoind.pid (systemd)
723664b5 54Lock file: /var/lock/subsys/bitcoind (CentOS)
234bfbf6
AW
55
56The configuration file, PID directory (if applicable) and data directory
57should all be owned by the bitcoin user and group. It is advised for security
58reasons to make the configuration file and data directory only readable by the
59bitcoin user and group. Access to bitcoin-cli and other bitcoind rpc clients
60can then be controlled by group membership.
61
624. Installing Service Configuration
63-----------------------------------
64
654a) systemd
66
7e6d23b1 67Installing this .service file consists of just copying it to
234bfbf6
AW
68/usr/lib/systemd/system directory, followed by the command
69"systemctl daemon-reload" in order to update running systemd configuration.
70
71To test, run "systemctl start bitcoind" and to enable for system startup run
72"systemctl enable bitcoind"
73
744b) OpenRC
75
76Rename bitcoind.openrc to bitcoind and drop it in /etc/init.d. Double
77check ownership and permissions and make it executable. Test it with
78"/etc/init.d/bitcoind start" and configure it to run on startup with
79"rc-update add bitcoind"
80
814c) Upstart (for Debian/Ubuntu based distributions)
82
83Drop bitcoind.conf in /etc/init. Test by running "service bitcoind start"
84it will automatically start on reboot.
85
86NOTE: This script is incompatible with CentOS 5 and Amazon Linux 2014 as they
723664b5 87use old versions of Upstart and do not supply the start-stop-daemon utility.
88
894d) CentOS
90
91Copy bitcoind.init to /etc/init.d/bitcoind. Test by running "service bitcoind start".
92
4fbfebea
MC
93Using this script, you can adjust the path and flags to the bitcoind program by
94setting the BITCOIND and FLAGS environment variables in the file
723664b5 95/etc/sysconfig/bitcoind. You can also use the DAEMONOPTS environment variable here.
234bfbf6
AW
96
975. Auto-respawn
98-----------------------------------
99
100Auto respawning is currently only configured for Upstart and systemd.
101Reasonable defaults have been chosen but YMMV.
102
This page took 0.080087 seconds and 4 git commands to generate.