Changeset View
Changeset View
Standalone View
Standalone View
doc/init.md
Show All 9 Lines | can be found in the contrib/init folder. | ||||
contrib/init/bitcoind.conf: Upstart service configuration file | contrib/init/bitcoind.conf: Upstart service configuration file | ||||
contrib/init/bitcoind.init: CentOS compatible SysV style init script | contrib/init/bitcoind.init: CentOS compatible SysV style init script | ||||
1. Service User | 1. Service User | ||||
--------------------------------- | --------------------------------- | ||||
All three Linux startup configurations assume the existence of a "bitcoin" user | All three Linux startup configurations assume the existence of a "bitcoin" user | ||||
and group. They must be created before attempting to use these scripts. | and group. They must be created before attempting to use these scripts. | ||||
The OS X configuration assumes bitcoind will be set up for the current user. | The macOS configuration assumes bitcoind will be set up for the current user. | ||||
2. Configuration | 2. Configuration | ||||
--------------------------------- | --------------------------------- | ||||
At a bare minimum, bitcoind requires that the rpcpassword setting be set | At a bare minimum, bitcoind requires that the rpcpassword setting be set | ||||
when running as a daemon. If the configuration file does not exist or this | when running as a daemon. If the configuration file does not exist or this | ||||
setting is not set, bitcoind will shutdown promptly after startup. | setting is not set, bitcoind will shutdown promptly after startup. | ||||
Show All 33 Lines | |||||
Lock file: `/var/lock/subsys/bitcoind` (CentOS) | Lock file: `/var/lock/subsys/bitcoind` (CentOS) | ||||
The configuration file, PID directory (if applicable) and data directory | The configuration file, PID directory (if applicable) and data directory | ||||
should all be owned by the bitcoin user and group. It is advised for security | should all be owned by the bitcoin user and group. It is advised for security | ||||
reasons to make the configuration file and data directory only readable by the | reasons to make the configuration file and data directory only readable by the | ||||
bitcoin user and group. Access to bitcoin-cli and other bitcoind rpc clients | bitcoin user and group. Access to bitcoin-cli and other bitcoind rpc clients | ||||
can then be controlled by group membership. | can then be controlled by group membership. | ||||
3b) Mac OS X | 3b) macOS | ||||
Binary: `/usr/local/bin/bitcoind` | Binary: `/usr/local/bin/bitcoind` | ||||
Configuration file: `~/Library/Application Support/Bitcoin/bitcoin.conf` | Configuration file: `~/Library/Application Support/Bitcoin/bitcoin.conf` | ||||
Data directory: `~/Library/Application Support/Bitcoin` | Data directory: `~/Library/Application Support/Bitcoin` | ||||
Lock file: `~/Library/Application Support/Bitcoin/.lock` | Lock file: `~/Library/Application Support/Bitcoin/.lock` | ||||
4. Installing Service Configuration | 4. Installing Service Configuration | ||||
----------------------------------- | ----------------------------------- | ||||
Show All 25 Lines | |||||
4d) CentOS | 4d) CentOS | ||||
Copy bitcoind.init to /etc/init.d/bitcoind. Test by running `service bitcoind start`. | Copy bitcoind.init to /etc/init.d/bitcoind. Test by running `service bitcoind start`. | ||||
Using this script, you can adjust the path and flags to the bitcoind program by | Using this script, you can adjust the path and flags to the bitcoind program by | ||||
setting the BITCOIND and FLAGS environment variables in the file | setting the BITCOIND and FLAGS environment variables in the file | ||||
/etc/sysconfig/bitcoind. You can also use the DAEMONOPTS environment variable here. | /etc/sysconfig/bitcoind. You can also use the DAEMONOPTS environment variable here. | ||||
4e) Mac OS X | 4e) macOS | ||||
Copy org.bitcoin.bitcoind.plist into ~/Library/LaunchAgents. Load the launch agent by | Copy org.bitcoin.bitcoind.plist into ~/Library/LaunchAgents. Load the launch agent by | ||||
running `launchctl load ~/Library/LaunchAgents/org.bitcoin.bitcoind.plist`. | running `launchctl load ~/Library/LaunchAgents/org.bitcoin.bitcoind.plist`. | ||||
This Launch Agent will cause bitcoind to start whenever the user logs in. | This Launch Agent will cause bitcoind to start whenever the user logs in. | ||||
NOTE: This approach is intended for those wanting to run bitcoind as the current user. | NOTE: This approach is intended for those wanting to run bitcoind as the current user. | ||||
You will need to modify org.bitcoin.bitcoind.plist if you intend to use it as a | You will need to modify org.bitcoin.bitcoind.plist if you intend to use it as a | ||||
Launch Daemon with a dedicated bitcoin user. | Launch Daemon with a dedicated bitcoin user. | ||||
5. Auto-respawn | 5. Auto-respawn | ||||
----------------------------------- | ----------------------------------- | ||||
Auto respawning is currently only configured for Upstart and systemd. | Auto respawning is currently only configured for Upstart and systemd. | ||||
Reasonable defaults have been chosen but YMMV. | Reasonable defaults have been chosen but YMMV. |