aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2020-10-25 12:38:54 +0000
committerLeo <thinkabit.ukim@gmail.com>2020-12-14 15:30:57 +0000
commit0c60a5fd867f9b1c9949028ca907ccd31dff15fd (patch)
tree03736db394fe667c92a203d97bdf1f0d9c7d20ee
parent8280fb3526defee1ee185d73d4897cd59e523c55 (diff)
downloadaports-0c60a5fd867f9b1c9949028ca907ccd31dff15fd.tar.gz
aports-0c60a5fd867f9b1c9949028ca907ccd31dff15fd.tar.bz2
aports-0c60a5fd867f9b1c9949028ca907ccd31dff15fd.tar.xz
community/bitcoin: revert to start-stop-daemon
* reverts the service script from using supervise-daemon back to using start-stop-daemon but in the modern style. This makes stopping of the bitcoin service reliable. * added a reload() function
-rw-r--r--community/bitcoin/APKBUILD1
-rw-r--r--community/bitcoin/bitcoin.conf4
-rw-r--r--community/bitcoin/bitcoin.initd27
3 files changed, 9 insertions, 23 deletions
diff --git a/community/bitcoin/APKBUILD b/community/bitcoin/APKBUILD
index b3b2feecba..eb18a87dba 100644
--- a/community/bitcoin/APKBUILD
+++ b/community/bitcoin/APKBUILD
@@ -7,7 +7,6 @@ pkgdesc="Decentralized P2P electronic cash system"
url="https://www.bitcoin.org"
arch="all !armhf !x86" # x86: segfault in check
license="MIT"
-options="!check" # temporarily disabled: https://github.com/bitcoin/bitcoin/issues/20236
makedepends="autoconf automake libtool boost-dev openssl-dev db-dev miniupnpc-dev
qt5-qtbase-dev qt5-qttools-dev protobuf-dev libqrencode-dev libevent-dev chrpath zeromq-dev"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-install"
diff --git a/community/bitcoin/bitcoin.conf b/community/bitcoin/bitcoin.conf
index 92bb57683e..3ac42a1ab9 100644
--- a/community/bitcoin/bitcoin.conf
+++ b/community/bitcoin/bitcoin.conf
@@ -9,8 +9,6 @@ rpcuser=changeme
rpcpassword=changeme
rpcport=changeme
-#### do not use daemon mode with new initd ####
-#### which now uses supervise-daemon ##########
-daemon=0
+daemon=1
#gen=1 #generate bitcoins
diff --git a/community/bitcoin/bitcoin.initd b/community/bitcoin/bitcoin.initd
index a9c63fffde..928912e3f4 100644
--- a/community/bitcoin/bitcoin.initd
+++ b/community/bitcoin/bitcoin.initd
@@ -1,5 +1,4 @@
#!/sbin/openrc-run
-supervisor=supervise-daemon
description="Bitcoin daemon"
name=bitcoind
@@ -8,28 +7,18 @@ config=/etc/bitcoin.conf
user=bitcoin
group=bitcoin
datadir=/var/lib/bitcoin
-pidfile="/run/bitcoin/$SVCNAME.sd.pid"
-command_args="-server -conf=$config -datadir=$datadir -pid=$pidfile"
-supervise_daemon_args="-u $user -g $group"
-nice="-19"
+pidfile="/run/bitcoin/$RC_SVCNAME.pid"
+command_user=${user}:${group}
+command_args="-server -conf=${config} -datadir=${datadir} -pid=${pidfile}"
+extra_started_commands="reload"
depend() {
use net
after logger firewall
}
-in_contr() {
- grep "container=" /proc/1/environ
-}
-
-start_pre() {
- # enforce permissions
- checkpath -q -d ${pidfile%/*} -o ${user}:${group}
- checkpath -q -d ${datadir} -m 0700 -o ${user}:${group}
- checkpath -q -f ${config} -m 0600 -o ${user}:${group}
-
- # in lxc sys_nice capability is dropped by default
- if [ -z "$(in_contr)" ]; then
- supervise_daemon_args="$supervise_daemon_args -N $nice"
- fi
+reload() {
+ ebegin "Reloading ${RC_SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $?
}