Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 445578

Summary: net-p2p/bitcoind - Hardcoded paths (/var/run/bitcoind.pid, /usr/bin/bitcoind, var directory) in init script, can they be made configurable?
Product: Gentoo Linux Reporter: Walter <walter>
Component: Current packagesAssignee: Anthony Basile <blueness>
Status: RESOLVED FIXED    
Severity: normal CC: linkermail, luke-jr+gentoobugs, proxy-maint
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Walter 2012-12-02 08:20:27 UTC
The paths /var/run/bitcoind.pid and /usr/bin/bitcoind are hardcoded at multiple places within the init script.

These paths should have a default, but be possible to specify within the /etc/conf.d/bitcoind file.

Similarly, VARDIR is fixed within the init script. It should be possible to specify within the /etc/conf.d/bitcoind file.

Reproducible: Always

Steps to Reproduce:
1. Attempt to use init script with non-standard paths
Actual Results:  
Init script errors.

Expected Results:  
Init script reports (whatever) path not found or bad, directs user to edit /etc/conf.d/bitcoind
Comment 1 Anthony Basile gentoo-dev 2014-08-29 00:15:40 UTC
We could do something like

    PIDFILE="${PIDFILE:-/var/run/bitcoind.pid}"
    DAEMON="${DAEMON:-/usr/bin/bitcoind}"

in init.d and then in conf.d we could include those variables set to their default values but commented out with explanations.  However, I feel uneasy about letting users change these default.  Alternatively, I would feel better just leaving them out of the conf.d and in init.d doing:

    PIDFILE="/var/run/bitcoind.pid"
    DAEMON="/usr/bin/bitcoind"

Users who really know what they're doing can edit the init.d

Unless I hear some compelling reason for why we need to allow users to change those default locations, I'm going with the later.
Comment 2 Walter 2014-08-29 02:39:23 UTC
The former (variable-based) is better for multi-instance (ie. bitcoind.miner, bitcoind.coldwallet).
Comment 3 Anthony Basile gentoo-dev 2014-08-30 17:35:55 UTC
(In reply to Walter from comment #2)
> The former (variable-based) is better for multi-instance (ie.
> bitcoind.miner, bitcoind.coldwallet).

Okay, you've convinced me, but I just realized that your original post was about the old bitcoin.initd scripts.  The new ones are bitcoin.initd-r1 and from a first glance, you should be able to run multiple instances by creating sym links like follows:

> cd /etc/init.d
> ln -s bitcoind bitcoind.miner
> /etc/init.d/bitcoind.miner start

This will start up the same command `/usr/bin/bitcoind` but give you different pid files for each.

I'm testing on my end.  Test on yours and let's see fi that's good enough.
Comment 4 Luke-Jr 2015-03-03 09:55:23 UTC
I believe this is fixed in 0.10.0-r1 in the bitcoin overlay.
Comment 5 Anthony Basile gentoo-dev 2015-03-04 00:33:25 UTC
this is now fixed in the tree.  reopen if its still a problem.