aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-03-13 18:52:32 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-03-13 18:52:35 +0100
commit3c631917f3e0da84ee48295b7d2e93bc202bae0c (patch)
treed55e6a2cbad8233b1bf5a1dbd1da635ea6eac370 /contrib
parente0bc27a14ceb18bfe3dd9ebdae6bef447c4ec922 (diff)
parent95f97111dd27f32dfcb461c9dd6890aa8d1355ed (diff)
downloadbitcoin-3c631917f3e0da84ee48295b7d2e93bc202bae0c.tar.xz
Merge #21111: Improve OpenRC initscript
95f97111dd27f32dfcb461c9dd6890aa8d1355ed contrib/init: (OpenRC) quote some unquoted variables. (parazyd) 737feadff7c026412039774de0d10931fe0c5bcc contrib/init: (OpenRC) Do not fail if both rpcuser and rpcpassword are unset. (parazyd) Pull request description: This pull request improves the available OpenRC initscripts in `contrib/init`. The first commit (737feadff7c026412039774de0d10931fe0c5bcc) reworks `checkconfig()` to not fail if **both** `rpcuser` and `rpcpassword` are unset, because this implies that bitcoind shall use the `.cookie` file for RPC authentication. Currently, the initscript does not allow starting bitcoind without a set `rpcuser` and `rpcpassword`. The second commit (95f97111dd27f32dfcb461c9dd6890aa8d1355ed) simply quotes some unquoted variables. ACKs for top commit: kristapsk: ACK 95f97111dd27f32dfcb461c9dd6890aa8d1355ed Tree-SHA512: 62bebcd07143c147e349c0cfc17b54ef21bd4684377b444f58c6bd1f509a4d3e1af58746fa7215f18e33021f691bbbc5e42f4df497458322b055e545b7f30d46
Diffstat (limited to 'contrib')
-rw-r--r--contrib/init/bitcoind.openrc7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/init/bitcoind.openrc b/contrib/init/bitcoind.openrc
index 86222295db..013a1a6070 100644
--- a/contrib/init/bitcoind.openrc
+++ b/contrib/init/bitcoind.openrc
@@ -60,16 +60,17 @@ start_pre() {
"${BITCOIND_PIDDIR}"
checkpath -f \
- -o ${BITCOIND_USER}:${BITCOIND_GROUP} \
+ -o "${BITCOIND_USER}:${BITCOIND_GROUP}" \
-m 0660 \
- ${BITCOIND_CONFIGFILE}
+ "${BITCOIND_CONFIGFILE}"
checkconfig || return 1
}
checkconfig()
{
- if ! grep -qs '^rpcpassword=' "${BITCOIND_CONFIGFILE}" ; then
+ if grep -qs '^rpcuser=' "${BITCOIND_CONFIGFILE}" && \
+ ! grep -qs '^rpcpassword=' "${BITCOIND_CONFIGFILE}" ; then
eerror ""
eerror "ERROR: You must set a secure rpcpassword to run bitcoind."
eerror "The setting must appear in ${BITCOIND_CONFIGFILE}"