From 737feadff7c026412039774de0d10931fe0c5bcc Mon Sep 17 00:00:00 2001 From: parazyd Date: Mon, 8 Feb 2021 11:27:16 +0100 Subject: [PATCH 1/2] contrib/init: (OpenRC) Do not fail if both rpcuser and rpcpassword are unset. This implies the .cookie file shall be used for RPC and having _both_ unset in bitcoin.conf should allow bitcoind to start. --- contrib/init/bitcoind.openrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/init/bitcoind.openrc b/contrib/init/bitcoind.openrc index 86222295db..876d6d5893 100644 --- a/contrib/init/bitcoind.openrc +++ b/contrib/init/bitcoind.openrc @@ -69,7 +69,8 @@ start_pre() { 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}" From 95f97111dd27f32dfcb461c9dd6890aa8d1355ed Mon Sep 17 00:00:00 2001 From: parazyd Date: Mon, 8 Feb 2021 11:29:40 +0100 Subject: [PATCH 2/2] contrib/init: (OpenRC) quote some unquoted variables. --- contrib/init/bitcoind.openrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/init/bitcoind.openrc b/contrib/init/bitcoind.openrc index 876d6d5893..013a1a6070 100644 --- a/contrib/init/bitcoind.openrc +++ b/contrib/init/bitcoind.openrc @@ -60,9 +60,9 @@ 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 }