Howdy, here's a pull request for bitcoind startup script for CentOS systems.
As discussed with ajweiss on IRC.
Let me know if you have feedback or questions.
Howdy, here's a pull request for bitcoind startup script for CentOS systems.
As discussed with ajweiss on IRC.
Let me know if you have feedback or questions.
Please add -disablewallet argument (maybe in the default example sysconfig/bitcoind file?). System-wide service should not have wallet enabled by default.
Please squash afterwards.
20 | + 21 | +prog=bitcoind 22 | +lockfile=/var/lock/subsys/bitcoind 23 | + 24 | +# bitcoind defaults to /usr/sbin/bitcoind 25 | +bitcoind=${BITCOIND-/usr/sbin/bitcoind}
bitcoind is installed to bin, not sbin
Probably would be better to use the same variable names as the existing init script, unless there's some RedHat/CentOS policy on how the variables ought be named.
@luke-jr , @paveljanik : I think I've reflected all the comments that have been input.
There's been some discussion about the path to bitcoind-- I understand that it's currently installed by default into /usr/bin/bitcoind , but pavel would like it put into /usr/sbin/bitcoind. Please let me know which way I should go with this script.
Also, looking at this: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/ch-sysconfig.html , there doesn't seem to be much in the way of conventions for env vars used in startup scripts in CentOS/RH systems, so I made them consistent with the file @luke-jr pointed out
After a few tests, I'd like to PR installing bitcoind into sbin instead of bin: https://github.com/paveljanik/bitcoin/commit/af092db6c81a6bad6208adaf5f645c8e3c5d6996
Currently bitcoind is installed into bin, and the init script should reflect that. When/if that changes, it can be updated here at that time. (FWIW, I think I disagree with installing bitcoind into sbin, but that is not a conversation for this PR)
@luke-jr , @paveljanik : all sounds good to me. Let me know if there's additional feedback on this PR
ut ACK
I just tested this on Centos 6.6 using this script:
https://github.com/joshrabinowitz/bitcoin-centos-installer/blob/master/bitcoind-install
and it works for stop, start, status, and restart
# service bitcoind stop
Stopping bitcoind: [ OK ]
# service bitcoind status
bitcoind is stopped
# service bitcoind start
Starting bitcoind: Bitcoin server starting
[ OK ]
# service bitcoind status
bitcoind (pid 22883) is running...
# service bitcoind restart
Stopping bitcoind: [ OK ]
Starting bitcoind: Bitcoin server starting
[ OK ]
# ps auxwww | grep bitcoin
USERNAME 7726 108 2.5 1297324 415728 ? Rsl 10:10 0:08 /opt/bitcoin/bin/bitcoind --conf=/home/USERNAME/.bitcoin/bitcoin.conf