Let systemd bitcoind write to /etc/bitcoin #14674

pull rodasmith wants to merge 1 commits into bitcoin:master from rodasmith:patch-1 changing 1 files +2 −1
  1. rodasmith commented at 12:09 AM on November 7, 2018: contributor

    The hardening measure ProtectSystem=full makes /etc read-only along with its subdirectories, including /etc/bitcoin. That prevents bitcoind from launching successfully when it finds it cannot write to /etc/bitcoin/debug.log and such.

    Exempt /etc/bitcoin with the directive ReadWritePaths=/etc/bitcoin

    To verify this change:

    1. Log in as root.
    2. Copy bitcoind.service to the relevant directory for your OS, e.g.:
    $ cp bitcoind.service /lib/systemd/system/bitcoind.service
    
    1. Reload systemd's daemon configs, enable, and start bitcoind through systemd:
    $ sudo systemctl daemon-reload
    $ sudo systemctl enable bitcoind
    $ sudo systemctl start bitcoind
    
    1. Verify that bitcoind launched successfully:
    $ sudo systemctl status bitcoind.service
    * bitcoind.service - Bitcoin daemon
       Loaded: loaded (/lib/systemd/system/bitcoind.service; enabled; vendor preset:
       Active: active (running) since 
    
  2. allow writes to /etc/bitcoin
    The hardening measure `ProtectSystem=full` makes /etc read-only along with its subdirectories, including /etc/bitcoin. That prevents bitcoind from launching successfully when it finds it cannot write to /etc/bitcoin/debug.log and such.
    
    Exempt /etc/bitcoin with the directive `ReadWritePaths=/etc/bitcoin`
    35e87db257
  3. fanquake added the label Scripts and tools on Nov 7, 2018
  4. luke-jr commented at 12:20 AM on November 7, 2018: member

    bitcoind should never be writing to /etc

    debug.log belongs under /var/lib

  5. DrahtBot commented at 12:27 AM on November 7, 2018: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  6. rodasmith commented at 4:27 AM on November 7, 2018: contributor

    Oh, I had apparently misinterpreted the intent of this file referring to /etc/bitcoin/bitcoin.conf . I thought that suggested that the files normally in ~/.bitcoin (including chainstate, data, and wallet directories) were meant to be placed in /etc/bitcoin when configured to launch automatically through systemd. Since that's apparently not the intent, I'll close this PR.

  7. rodasmith closed this on Nov 7, 2018

  8. MarcoFalke locked this on Sep 8, 2021

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-04-26 06:14 UTC

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