summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgostino Sarubbo <ago@gentoo.org>2019-05-02 11:02:29 +0200
committerAgostino Sarubbo <ago@gentoo.org>2019-05-02 11:02:29 +0200
commit1d4c6a161fe7bd63405c8a46af347201f875580e (patch)
tree2a91565c3052ff98e8643f02bcb963fe32f27216
parentapp-metrics/uniloader: First commit for queuemetrics/uniloader (diff)
downloadago-1d4c6a161fe7bd63405c8a46af347201f875580e.tar.gz
ago-1d4c6a161fe7bd63405c8a46af347201f875580e.tar.bz2
ago-1d4c6a161fe7bd63405c8a46af347201f875580e.zip
app-metrics/queuemetrics: First commit for queuemetrics/uniloader
Signed-off-by: Agostino Sarubbo <ago@gentoo.org> Package-Manager: Portage-2.3.62, Repoman-2.3.11
-rw-r--r--app-metrics/queuemetrics/ChangeLog5
-rw-r--r--app-metrics/queuemetrics/Manifest7
-rw-r--r--app-metrics/queuemetrics/files/queuemetrics.confd34
-rw-r--r--app-metrics/queuemetrics/files/queuemetrics.initd65
-rw-r--r--app-metrics/queuemetrics/metadata.xml12
-rw-r--r--app-metrics/queuemetrics/queuemetrics-19.04.1.ebuild55
6 files changed, 178 insertions, 0 deletions
diff --git a/app-metrics/queuemetrics/ChangeLog b/app-metrics/queuemetrics/ChangeLog
new file mode 100644
index 0000000..7869328
--- /dev/null
+++ b/app-metrics/queuemetrics/ChangeLog
@@ -0,0 +1,5 @@
+*queuemetrics-19.04.1 (02 May 2019)
+
+ 02 May 2019; Agostino Sarubbo <ago@gentoo.org> +files/queuemetrics.confd,
+ +files/queuemetrics.initd, +metadata.xml, +queuemetrics-19.04.1.ebuild:
+ app-metrics/queuemetrics: First commit for queuemetrics/uniloader
diff --git a/app-metrics/queuemetrics/Manifest b/app-metrics/queuemetrics/Manifest
new file mode 100644
index 0000000..ed0ae4c
--- /dev/null
+++ b/app-metrics/queuemetrics/Manifest
@@ -0,0 +1,7 @@
+AUX queuemetrics.confd 1529 SHA256 b9906714fab468ec3d1e973758b04ca419afc5a7f28271ff8c6764abec6a483e SHA512 46b0bbac59c4bebb1bace5b79b165d120cadac8fd4e414bac727948d08da2693692223a63df41ce78b189b5b059f5308d7d96419e03f67bd66da153254ac61dd WHIRLPOOL 2b0b6ec17490bf29c5a61a7e19406e1f0a0c2d642f78c36fed3e2353c8fcaee07c702165ecaae460b9d248e572a6fb7595bcb31525e119de548edba9b3eb9fbf
+AUX queuemetrics.initd 1506 SHA256 bce480d82bb3ca0228b1a2bbee7c0c0ab573b287de613f909728a725ed2c0f4d SHA512 bedf46f5199f2c509b3d3162629dfa824fc9ad19a0bc7151d809a6dfb9da9e25ff8b6894858b3f7ff54ec913fb735a70976c191c68e8141ba80e22d7af3d5a67 WHIRLPOOL 0f9b3abf557185d65c62cdc7619baed251dc177371537d261e08a02b6509386326cc8fcf7db19b7e197c980743905df1d0310bda194030885c39b66563642a7b
+DIST QueueMetrics-19.04.1.tar.gz 15392742 SHA256 02e2dd048077cb060166bc08fbe0e306c90c1b1ec1078f008fc77bb0bd2319d6 SHA512 9893c4932bd44203eff781dae5ac5ccd8f798e57b35f268abd311fb0be9b4b432a4efd76f93a5c164da45e73c2e9c17a2b902ef30198efe82eab47d403202baf WHIRLPOOL 2f9f608276a114d122c3b3f89ac014c35a4b360d338ebb0faf711a25d306aa3ca1001a1fd195693b94c4b926bb5f033b4ca898c363f83b39fd55a51331fc21c9
+DIST apache-tomcat-8.5.40.tar.gz 9690027 SHA256 2c429a686feec086d654ac8a2b7df65a89f3b6017678c530d1ecedf35401e3d3 SHA512 5bdea5414713c9ba39e226f062701fa14998b1a798c9750f956a0f59b5edabb8d83af9ec9f81cf9f47fa92c21b560c9b2be1b543d0bd8f1b49579b69101d3a8f WHIRLPOOL 7a643a66d044bd6f0e1838c795d607d1936ee36d373c7f0ada525bdf1aea289235a73684c0b03c5ea9b767b3c0338a4bd9619957774520b667b9b43a3ddacf5d
+EBUILD queuemetrics-19.04.1.ebuild 1302 SHA256 90036c3df61796179a199b6b9e637b89158fb4e2933f5b0b4312f3d36fb9f7ce SHA512 b273e1046613954eabba5f73b086be68f0a7b41716d02dae9732f22b7b674ff02c7938e3eebe2d782d194a54af3bd41931539412a90acc2ef98a1074549ff03a WHIRLPOOL eee8b21ec67cbb317e577e76d4628ffd8d008bcd056f23119ac09d5b43c2c1f094a83f4e799d2c17381cecab0a8c2be6b827a4fe34458959021ea28c20add13e
+MISC ChangeLog 255 SHA256 6050841257dd95e121321c008eab35c78456ef6276da251a9fbd0d4adfdf1219 SHA512 fe9b97aeaf5729828ef219855e44b919868c31a2ab3505cf96f141c1aed8945d4e905c02998e677977b239a3d2ea691b38d144183e55f2c1133fb81c2dc09aab WHIRLPOOL 3333bd6fab308a2e3759fd97733cc7e964c5f347f1c28f8aa035151cf976a534aff73c0628afcfc4a63a3c28bc808799e1ca5e8ffadae361d1748b40a7991a7d
+MISC metadata.xml 389 SHA256 3d4f1ca7609f74c3bddef49ce0d31edb1b23cd221ee6abe001abecaac65ec87e SHA512 52df615f053daaa05ae886a8c32149d4b714e7cb8e03804fc39b16160dd3f1381645c9d5a15ce113e875234fbecbf005879dd57bbb418eddfcc901354da498f2 WHIRLPOOL 506f357243b5b1bb8e427132b19b86865932dba8344c895debb1074fa301f308850ced982a2eb29c5becebfa788b5ed7465fd285e2bf53bae95a8d680fe8cc20
diff --git a/app-metrics/queuemetrics/files/queuemetrics.confd b/app-metrics/queuemetrics/files/queuemetrics.confd
new file mode 100644
index 0000000..3274a9f
--- /dev/null
+++ b/app-metrics/queuemetrics/files/queuemetrics.confd
@@ -0,0 +1,34 @@
+CATALINA_BASE="/opt/queuemetrics/tomcat"
+CATALINA_HOME="${CATALINA_BASE}"
+CATALINA_TMPDIR="${CATALINA_HOME}/temp"
+CLASSPATH="${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar"
+
+JAVA_OPTS="-server \
+ -Xms1024m \
+ -Xmx1024m \
+ -Djava.util.logging.config.file=${CATALINA_HOME}/conf/logging.properties \
+ -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
+ -Djdk.tls.ephemeralDHKeySize=2048 \
+ -Djava.protocol.handler.pkgs=org.apache.catalina.webresources \
+ -Djava.security.egd=file:/dev/./urandom \
+ -Djava.endorsed.dirs=${CATALINA_HOME}/endorsed \
+ -classpath "${CLASSPATH}" \
+ -Dcatalina.base="${CATALINA_BASE}" \
+ -Dcatalina.home="${CATALINA_HOME}" \
+ -Djava.io.tmpdir="${CATALINA_TMPDIR}" \
+ -Dtomcat.instance=queuemetrics \
+ -XX:+UseG1GC
+ -XX:MaxGCPauseMillis=500 \
+ -XX:InitiatingHeapOccupancyPercent=45 \
+ -XX:+PrintGCDateStamps \
+ -verbose:gc \
+ -XX:+PrintGCDetails \
+ -Xloggc:/opt/queuemetrics/tomcat/logs/gc.log \
+ -XX:+UseGCLogFileRotation \
+ -XX:NumberOfGCLogFiles=5 \
+ -XX:GCLogFileSize=50M \
+ -XX:+HeapDumpOnOutOfMemoryError \
+ -XX:HeapDumpPath=/opt/queuemetrics/tomcat/logs/hprof.hprof \
+ -Dorg.apache.catalina.connector.RECYCLE_FACADES=true \
+ -Dorg.apache.catalina.core.StandardHostValve.ACCESS_SESSION=true \
+"
diff --git a/app-metrics/queuemetrics/files/queuemetrics.initd b/app-metrics/queuemetrics/files/queuemetrics.initd
new file mode 100644
index 0000000..d36c70f
--- /dev/null
+++ b/app-metrics/queuemetrics/files/queuemetrics.initd
@@ -0,0 +1,65 @@
+#!/sbin/openrc-run
+# Copyright 2019 Agostino Sarubbo <ago@gentoo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+PIDFILE="/run/queuemetrics.pid"
+
+start() {
+ ebegin "Starting queuemetrics"
+ start-stop-daemon \
+ --start \
+ --quiet \
+ --background \
+ --stdout ${CATALINA_HOME}/logs/catalina.out \
+ --stderr ${CATALINA_HOME}/logs/catalina.out \
+ --chdir ${CATALINA_TMPDIR} \
+ --user queuemetrics:queuemetrics \
+ --make-pidfile --pidfile ${PIDFILE} \
+ --exec java \
+ -- \
+ ${JAVA_OPTS} \
+ org.apache.catalina.startup.Bootstrap \
+ start
+ eend $?
+}
+
+stop() {
+ MYPID="$( cat ${PIDFILE} )"
+
+ ebegin "Stopping queuemetrics"
+ start-stop-daemon \
+ --stop \
+ --quiet \
+ --stdout ${CATALINA_HOME}/logs/catalina.out \
+ --stderr ${CATALINA_HOME}/logs/catalina.out \
+ --retry=60 \
+ --pidfile ${PIDFILE} \
+ --exec java \
+ -- \
+ ${JAVA_OPTS} \
+ org.apache.catalina.startup.Bootstrap \
+ stop
+ sleep 5
+
+ # check if the pid still exist and wait fro graceful shutdown
+ COUNT="1"
+ while [ ! -z "$( ps -p ${MYPID} | grep ${MYPID} )" -a "${COUNT}" -lt "5" ]
+ do
+ echo "Waiting queuemetrics stop for 3 seconds"
+ sleep 3
+ let COUNT++
+ done
+
+ # if the pid still exists, then kill it
+ if [ ! -z "$( ps -p ${MYPID} | grep ${MYPID} )" ]
+ then
+ start-stop-daemon --stop --quiet --pidfile ${PIDFILE} --signal=9
+ kill -9 ${MYPID}
+ fi
+
+ # WIPE temp and work
+ rm ${CATALINA_HOME}/temp/* -fr
+ rm ${CATALINA_HOME}/work/* -fr
+
+ eend $?
+}
diff --git a/app-metrics/queuemetrics/metadata.xml b/app-metrics/queuemetrics/metadata.xml
new file mode 100644
index 0000000..64cedbb
--- /dev/null
+++ b/app-metrics/queuemetrics/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ago@gentoo.org</email>
+ <name>Agostino Sarubbo</name>
+ </maintainer>
+ <use>
+ <flag name="mysql">Installs a mysql server</flag>
+ <flag name="uniloader">Installs uniloader as app-metrics/uniloader</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-metrics/queuemetrics/queuemetrics-19.04.1.ebuild b/app-metrics/queuemetrics/queuemetrics-19.04.1.ebuild
new file mode 100644
index 0000000..297fde4
--- /dev/null
+++ b/app-metrics/queuemetrics/queuemetrics-19.04.1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# DISCLAIMER:
+# This ebuild does NOT follow the Gentoo QA Rules, instead it follows the upstream way to install and run the application
+
+EAPI=7
+
+inherit user
+
+TOMCAT_VERSION="8.5.40"
+
+DESCRIPTION="A monitoring and reporting suite for asterisk based PBX"
+HOMEPAGE="https://www.queuemetrics.com"
+LICENSE="all-rights-reserved"
+SRC_URI="http://downloads.loway.ch/qm/tomcat/apache-tomcat-${TOMCAT_VERSION}.tar.gz http://downloads.loway.ch/qm/QueueMetrics-${PV}.tar.gz"
+RESTRICT="mirror"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+mysql uniloader"
+
+RDEPEND="virtual/jdk:1.8"
+PDEPEND="mysql? ( virtual/mysql[server] )
+ uniloader? ( app-metrics/uniloader )"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_prepare() {
+ ewarn
+ ewarn
+ ewarn "This ebuild will restart your queuemetrics instance"
+ ewarn
+ ewarn
+ sleep 5
+ default
+}
+
+src_install() {
+ dodir /opt/${PN}/tomcat/{logs,temp,webapps,work}
+ insinto /opt/${PN}/tomcat
+ doins -r apache-tomcat-${TOMCAT_VERSION}/{bin,conf,lib}
+
+ fowners -R ${PN}:${PN} /opt/${PN}
+ fperms 0750 /opt/${PN}
+
+ cp -r ${P} "${D}"/opt/${PN}/tomcat/webapps/${PN}
+
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+}