summaryrefslogtreecommitdiff
path: root/net-p2p/monero/files
diff options
context:
space:
mode:
authorBertrand Jacquin <bertrand@jacquin.bzh>2020-01-19 16:35:04 +0000
committerBertrand Jacquin <bertrand@jacquin.bzh>2020-01-21 02:17:44 +0000
commit758c57253b02aea39a3a0532e4c89aef00a04faf (patch)
tree07b25646758c4e677d289d9622aaba0fd8bd2000 /net-p2p/monero/files
parentdev-libs/randomx: version bump (diff)
downloadportage-758c57253b02aea39a3a0532e4c89aef00a04faf.tar.xz
net-p2p/monero: add openrc initd
Package-Manager: Portage-2.3.79, Repoman-2.3.16
Diffstat (limited to 'net-p2p/monero/files')
-rwxr-xr-xnet-p2p/monero/files/monerod.initd38
1 files changed, 38 insertions, 0 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 $?
+}