summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xnet-p2p/monero/files/monerod.initd38
-rw-r--r--net-p2p/monero/monero-0.15.0.1.ebuild3
2 files changed, 40 insertions, 1 deletions
diff --git a/net-p2p/monero/files/monerod.initd b/net-p2p/monero/files/monerod.initd
new file mode 100755
index 00000000..d768c163
--- /dev/null
+++ b/net-p2p/monero/files/monerod.initd
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+: ${MONERO_CONFIG:=/etc/monerod.conf}
+: ${MONERO_USER:=monero}
+: ${MONERO_GROUP:=monero}
+
+PIDFILE="/run/${SVCNAME}.pid"
+
+depend() {
+ need net
+}
+
+start() {
+ checkpath --quiet \
+ --file \
+ --owner "${MONERO_USER}:${MONERO_GROUP}" \
+ "${PIDFILE}" \
+ || return 1
+
+ ebegin "Starting ${RC_SVCNAME}"
+ start-stop-daemon --start --quiet \
+ --user "${MONERO_USER}:${MONERO_GROUP}" \
+ --exec "/usr/bin/${RC_SVCNAME}" \
+ -- \
+ --detach --non-interactive \
+ --pidfile "${PIDFILE}" \
+ --config "${MONERO_CONFIG}"
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping ${RC_SVCNAME}"
+ start-stop-daemon --stop \
+ --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/net-p2p/monero/monero-0.15.0.1.ebuild b/net-p2p/monero/monero-0.15.0.1.ebuild
index c9874f05..c50d5380 100644
--- a/net-p2p/monero/monero-0.15.0.1.ebuild
+++ b/net-p2p/monero/monero-0.15.0.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -119,5 +119,6 @@ src_install() {
insinto /etc
doins utils/conf/monerod.conf
+ newinitd "${FILESDIR}/monerod.initd" monerod
systemd_dounit utils/systemd/monerod.service
}