mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-25 12:15:32 +03:00
https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.14.0.md initd now uses supervise-daemon for service supervision. please note the new bitcoin.conf format => do NOT enable daemon mode as supervise-daemon requires services to run in the foreground.
35 lines
798 B
Text
35 lines
798 B
Text
#!/sbin/openrc-run
|
|
supervisor=supervise-daemon
|
|
|
|
description="Bitcoin daemon"
|
|
name=bitcoind
|
|
command=/usr/bin/$name
|
|
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"
|
|
|
|
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
|
|
}
|