summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2016-07-18 17:33:01 +0200
committerPatrick Lauer <patrick@gentoo.org>2016-07-18 17:35:34 +0200
commit21e1ed587a5f803da0b927a8f3f95e3e5f624a11 (patch)
tree210d79f41fe645100604a2403b116b8e0a4b2604 /www-apps
parentmedia-gfx/gimp: Support gegl 0.3.8 (bug #586828) (diff)
downloadgentoo-21e1ed587a5f803da0b927a8f3f95e3e5f624a11.tar.gz
gentoo-21e1ed587a5f803da0b927a8f3f95e3e5f624a11.tar.bz2
gentoo-21e1ed587a5f803da0b927a8f3f95e3e5f624a11.zip
www-apps/grafana-bin: Fix pidfile handling
Package-Manager: portage-2.3.0
Diffstat (limited to 'www-apps')
-rw-r--r--www-apps/grafana-bin/files/grafana.initd.235
-rw-r--r--www-apps/grafana-bin/grafana-bin-3.1.0-r1.ebuild (renamed from www-apps/grafana-bin/grafana-bin-3.1.0.ebuild)2
2 files changed, 36 insertions, 1 deletions
diff --git a/www-apps/grafana-bin/files/grafana.initd.2 b/www-apps/grafana-bin/files/grafana.initd.2
new file mode 100644
index 000000000000..14b0b1fdfa04
--- /dev/null
+++ b/www-apps/grafana-bin/files/grafana.initd.2
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+}
+
+start() {
+ ebegin "Starting grafana server"
+
+ start-stop-daemon --start -b \
+ --make-pidfile \
+ --pidfile /run/grafana.pid \
+ --chdir /usr/share/grafana \
+ --user ${GRAFANA_USER}:${GRAFANA_GROUP} \
+ --exec /usr/bin/grafana-server -- \
+ -config=/etc/grafana/grafana.ini \
+ cfg:default.paths.data=/var/lib/grafana \
+ cfg:default.paths.logs=/var/log/grafana
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping grafana server"
+
+ start-stop-daemon --stop \
+ --pidfile /run/grafana.pid \
+ --user "${GRAFANA_USER}" \
+ --retry=TERM/20/KILL/5
+
+ eend $?
+}
diff --git a/www-apps/grafana-bin/grafana-bin-3.1.0.ebuild b/www-apps/grafana-bin/grafana-bin-3.1.0-r1.ebuild
index 159d2d8894ee..37523480bc5a 100644
--- a/www-apps/grafana-bin/grafana-bin-3.1.0.ebuild
+++ b/www-apps/grafana-bin/grafana-bin-3.1.0-r1.ebuild
@@ -43,7 +43,7 @@ src_install() {
dobin bin/grafana-server
newconfd "${FILESDIR}"/grafana.confd grafana
- newinitd "${FILESDIR}"/grafana.initd grafana
+ newinitd "${FILESDIR}"/grafana.initd.2 grafana
keepdir /var/{lib,log}/grafana
fowners grafana:grafana /var/{lib,log}/grafana