Skip to content

Commit 3c63191

Browse files
author
MarcoFalke
committed
Merge #21111: Improve OpenRC initscript
95f9711 contrib/init: (OpenRC) quote some unquoted variables. (parazyd) 737fead 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 (737fead) 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 (95f9711) simply quotes some unquoted variables. ACKs for top commit: kristapsk: ACK 95f9711 Tree-SHA512: 62bebcd07143c147e349c0cfc17b54ef21bd4684377b444f58c6bd1f509a4d3e1af58746fa7215f18e33021f691bbbc5e42f4df497458322b055e545b7f30d46
2 parents e0bc27a + 95f9711 commit 3c63191

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

contrib/init/bitcoind.openrc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,17 @@ start_pre() {
6060
"${BITCOIND_PIDDIR}"
6161

6262
checkpath -f \
63-
-o ${BITCOIND_USER}:${BITCOIND_GROUP} \
63+
-o "${BITCOIND_USER}:${BITCOIND_GROUP}" \
6464
-m 0660 \
65-
${BITCOIND_CONFIGFILE}
65+
"${BITCOIND_CONFIGFILE}"
6666

6767
checkconfig || return 1
6868
}
6969

7070
checkconfig()
7171
{
72-
if ! grep -qs '^rpcpassword=' "${BITCOIND_CONFIGFILE}" ; then
72+
if grep -qs '^rpcuser=' "${BITCOIND_CONFIGFILE}" && \
73+
! grep -qs '^rpcpassword=' "${BITCOIND_CONFIGFILE}" ; then
7374
eerror ""
7475
eerror "ERROR: You must set a secure rpcpassword to run bitcoind."
7576
eerror "The setting must appear in ${BITCOIND_CONFIGFILE}"

0 commit comments

Comments
 (0)