diff options
author | Matthew Brewer <tomboy64@sina.cn> | 2017-05-29 17:37:31 +0200 |
---|---|---|
committer | Matthew Brewer <tomboy64@sina.cn> | 2017-05-30 00:26:27 +0200 |
commit | e3bf6ad0559b9eb70e0dc4301d75298be7cd758c (patch) | |
tree | 2390edb7378f3b41cde387a64dcc21070d166cac /net-p2p/monero/files/monerod.runscript | |
parent | add dev-perl/RPM2-1.300.0.ebuild (diff) | |
download | tbc-e3bf6ad0559b9eb70e0dc4301d75298be7cd758c.tar.gz tbc-e3bf6ad0559b9eb70e0dc4301d75298be7cd758c.tar.bz2 tbc-e3bf6ad0559b9eb70e0dc4301d75298be7cd758c.zip |
net-p2p/monero: new package
Package-Manager: Portage-2.3.6, Repoman-2.3.2
Diffstat (limited to 'net-p2p/monero/files/monerod.runscript')
-rw-r--r-- | net-p2p/monero/files/monerod.runscript | 72 |
1 files changed, 72 insertions, 0 deletions
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 $? +} |