Steps to reproduce: 1. emerge bitcoind 2. emerge --depclean --with-bdeps=y (pkgconfig is depcleaned) 3. /etc/init.d/bitcoind start See message in terminal: /etc/init.d/bitcoind: line 46: pkg-config: command not found
This is one of the worst init scripts in Gentoo I've ever seen.
Created attachment 369772 [details] bitcoin.initd Please find attached a rewritten init script. I haven't tested it as I don't use bitcoind but if someone else tests it and reports any possible problems here I'm happy to help sorting these problems out.
Lars, is that the whole init script? Not that I'm an expert on the topic, but I think it may be missing some start(), stop() functions.
(In reply to palme3000 from comment #3) > Lars, is that the whole init script? > > Not that I'm an expert on the topic, but I think it may be missing some > start(), stop() functions. Yes, that is the whole init script. Openrc adds default start()/stop() functions when the init script doesn't come with its own functions. If you don't believe me, just have a look at /etc/init.d/rsyncd script ;)
It's really hard to believe it when `ps aux | grep bitcoin` gives 0 results :D - bitcoind_user="${BITCOIND_USER:-nobody:nobody} + bitcoind_user="${BITCOIN_USER:-nobody:nobody} - star_pre() { + start_pre() {
Created attachment 369792 [details] bitcoin.initd (In reply to palme3000 from comment #5) > It's really hard to believe it when `ps aux | grep bitcoin` gives 0 results > :D > > - bitcoind_user="${BITCOIND_USER:-nobody:nobody} > + bitcoind_user="${BITCOIN_USER:-nobody:nobody} > > - star_pre() { > + start_pre() { Thanks for the fixes. I assume these fixes were enough to make the init script work? Attached is an updated init script with your fixes included.
I believe so. One pet peeve is that if bitcoind fails to start, because for example data dir is read-only, there's not much errors displayed by openrc script.
Created attachment 369794 [details] bitcoin.initd (In reply to palme3000 from comment #7) > I believe so. > > One pet peeve is that if bitcoind fails to start, because for example data > dir is read-only, there's not much errors displayed by openrc script. That might be because I forgot to re-implement the "--wait 30000" option. Attached is (another) fixed version of the init script which might take care of that problem.
Maybe --wait 3000 ? 30000 is really long if you have bitcoind in default runlevel. Other than that, it's all good.
(In reply to palme3000 from comment #9) > Maybe --wait 3000 ? 30000 is really long if you have bitcoind in default > runlevel. > > Other than that, it's all good. 30000 is the value in the old init script for stopping the daemon. If you can confirm that waiting 3000 milliseconds is enough for openrc to see bitcoind being stopped then I have no problems in reducing the wait time. If you want you can also try a wait value of 2000 milliseconds. That is the wait time for startup with openrc in the old script.
Created attachment 369802 [details] bitcoin.initd Okay, I just read in start-stop-daemon man page that you cannot use --wait when stopping a daemon (although this used to work once). So here's another reworked script with --wait milliseconds for startup set to 2000.
(In reply to Lars Wendler (Polynomial-C) from comment #11) > Created attachment 369802 [details] > bitcoin.initd > > Okay, I just read in start-stop-daemon man page that you cannot use --wait > when stopping a daemon (although this used to work once). > So here's another reworked script with --wait milliseconds for startup set > to 2000. Lars, is this ready to go? I'll commit with a rev bump.
(In reply to Anthony Basile from comment #12) > > Lars, is this ready to go? I'll commit with a rev bump. Yes, this is ready to go.
(In reply to Lars Wendler (Polynomial-C) from comment #13) > (In reply to Anthony Basile from comment #12) > > > > Lars, is this ready to go? I'll commit with a rev bump. > > Yes, this is ready to go. Okay this is on the tree with bitcoind-0.8.6-r1. Please test! Note that I also maintain the following: litecoind ppcoind datacoin-hp primecoind where I just copied over the original initd from the bitcoin overlay and edited it for the different names. Once I've gotten feedback about whether the new initd works, I'll propagate the fixed initd there. Please don't close this bug, let me do it.
Hey. Just tested latest bump, can confirm that it works fine. Lars, Anthony, thanks for the updates.
(In reply to palme3000 from comment #15) > Hey. > Just tested latest bump, can confirm that it works fine. > Lars, Anthony, thanks for the updates. Thanks for testing. I've now added the improved initd script to litecoind ppcoind datacoin-hp primecoind I don't know if you're using those, but if you are, please test there too. Reopen this bug if there's still an issue. Thanks everyone!