summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/grafana-bin/files/grafana.initd')
-rw-r--r--www-apps/grafana-bin/files/grafana.initd34
1 files changed, 34 insertions, 0 deletions
diff --git a/www-apps/grafana-bin/files/grafana.initd b/www-apps/grafana-bin/files/grafana.initd
new file mode 100644
index 000000000000..ecbd2e22d814
--- /dev/null
+++ b/www-apps/grafana-bin/files/grafana.initd
@@ -0,0 +1,34 @@
+#!/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 \
+ --chdir /usr/share/grafana \
+ --user ${GRAFANA_USER}:${GRAFANA_GROUP} \
+ --exec /usr/bin/grafana-server -- \
+ -pidfile=/run/grafana.pid \
+ -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 $?
+}