contrib/init: fix unused variables in openrc script #35978

pull jpk68 wants to merge 1 commits into bitcoin:master from jpk68:openrc-vars changing 1 files +2 −1
  1. jpk68 commented at 11:05 PM on August 14, 2026: none
    • Makes it so that ${BITCOIND_BIN} is actually used as command=, rather than the hardcoded /usr/bin/bitcoind.
    • Passes BITCOIND_GROUP to start-stop-daemon, so that the daemon process itself runs under it.
  2. contrib/init: fix unused variables in openrc script d837bb38a4
  3. DrahtBot commented at 11:06 PM on August 14, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35978.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK winterrdog, jeanpablojp

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. sedited commented at 1:08 PM on August 18, 2026: contributor

    The variable reuse seems fine, but would you say that passing the group in is a bug fix?

  5. jpk68 commented at 7:26 PM on August 18, 2026: none

    The variable reuse seems fine, but would you say that passing the group in is a bug fix?

    Yes, I think it is.

  6. winterrdog commented at 11:08 PM on August 18, 2026: contributor

    utACK d837bb38a44de445d2c459a477302d78871ae1a6

    reply-to: #35978 (comment)

    but would you say that passing the group in is a bug fix?

    it is a genuine bug fix, just one that rarely triggers because BITCOIND_GROUP defaults to bitcoin, which is also typically the bitcoin user's primary group, so the two coincide by default. it only shows up when BITCOIND_GROUP is overridden to something else

    start_pre() already sets the datadir, PID directory, and config file ownership to ${BITCOIND_USER}:${BITCOIND_GROUP}. without -g, the daemon instead runs under the user's primary group, so the two can diverge when BITCOIND_GROUP is intentionally overridden, potentially affecting access to files the daemon creates or accesses at runtime. adding -g ${BITCOIND_GROUP} fixes that by making the daemon use the same group configured by start_pre()

  7. jeanpablojp commented at 3:04 PM on August 19, 2026: contributor

    utACK d837bb38a44de445d2c459a477302d78871ae1a6

    I also agree this is a bug. Another concrete example I found is -rpccookieperms=group. That makes the .cookie group-readable, but by the user's primary group and not by the BITCOIND_GROUP that start_pre() put on the datadir.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-21 04:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me