diff options
Diffstat (limited to 'net-p2p/monero/files')
-rw-r--r-- | net-p2p/monero/files/monero.conf | 4 | ||||
-rw-r--r-- | net-p2p/monero/files/monerod.conf | 7 | ||||
-rw-r--r-- | net-p2p/monero/files/monerod.runscript | 72 | ||||
-rw-r--r-- | net-p2p/monero/files/monerod.service | 11 |
4 files changed, 94 insertions, 0 deletions
diff --git a/net-p2p/monero/files/monero.conf b/net-p2p/monero/files/monero.conf new file mode 100644 index 0000000..9b9d7e1 --- /dev/null +++ b/net-p2p/monero/files/monero.conf @@ -0,0 +1,4 @@ +#rpcuser=username +#rpcpassword=password +#rpcallowip=127.0.0.1 +#rpcport= diff --git a/net-p2p/monero/files/monerod.conf b/net-p2p/monero/files/monerod.conf new file mode 100644 index 0000000..4950abc --- /dev/null +++ b/net-p2p/monero/files/monerod.conf @@ -0,0 +1,7 @@ +# Config file for monerod + +MONERO_USER="monero" + +MONERO_OPTS="${MONERO_OPTS}" + +NICELEVEL="19" diff --git a/net-p2p/monero/files/monerod.runscript b/net-p2p/monero/files/monerod.runscript new file mode 100644 index 0000000..f89c470 --- /dev/null +++ b/net-p2p/monero/files/monerod.runscript @@ -0,0 +1,72 @@ +#!/sbin/openrc-run +# Distributed under the terms of the GNU General Public License, v2 or later + +VARDIR="/var/lib/monero" +CONFFILE="${VARDIR}/.bitmonero/bitmonero.conf" + +depend() { + need net +} + +start() { + ebegin "Starting Monero daemon" + + pkg-config openrc + if [ $? = 0 ]; then + start_openrc + else + start_baselayout + fi +} + +stop() { + ebegin "Stopping Monero daemon" + + pkg-config openrc + if [ $? = 0 ]; then + stop_openrc + else + stop_baselayout + fi +} + +start_openrc() { + start-stop-daemon \ + --start --user "${MONERO_USER}" --name monerod \ + --pidfile /var/run/monerod.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/monerod \ + --nicelevel "${NICELEVEL}" \ + --background \ + --wait 2000 \ + -- ${MONERO_OPTS} + eend $? +} + +stop_openrc() { + start-stop-daemon --stop --user "${MONERO_USER}" \ + --name monerod --pidfile /var/run/monerod.pid \ + --wait 30000 \ + --progress + eend $? +} + +start_baselayout() { + start-stop-daemon \ + --start --user "${MONERO_USER}" --name monerod \ + --pidfile /var/run/monerod.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/monerod \ + --chuid "${MONERO_USER}" \ + --nicelevel "${NICELEVEL}" \ + --background \ + -- ${MONERO_OPTS} + eend $? +} + +stop_baselayout() { + start-stop-daemon \ + --stop \ + --user "${MONERO_USER}" \ + --name monerod \ + --pidfile /var/run/monerod.pid + eend $? +} diff --git a/net-p2p/monero/files/monerod.service b/net-p2p/monero/files/monerod.service new file mode 100644 index 0000000..ef2a731 --- /dev/null +++ b/net-p2p/monero/files/monerod.service @@ -0,0 +1,11 @@ +[Unit] +Description=Monero Daemon +After=network.target + +[Service] +User=monero +ExecStart=/usr/bin/monerod --non-interactive $MONERO_OPTS +ExecReload=/bin/kill -INT $MAINPID + +[Install] +WantedBy=multi-user.target |