summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/kibana-bin/files/kibana.initd')
-rw-r--r--www-apps/kibana-bin/files/kibana.initd39
1 files changed, 39 insertions, 0 deletions
diff --git a/www-apps/kibana-bin/files/kibana.initd b/www-apps/kibana-bin/files/kibana.initd
new file mode 100644
index 000000000000..9effc545218e
--- /dev/null
+++ b/www-apps/kibana-bin/files/kibana.initd
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+command="/opt/kibana/bin/kibana"
+pidfile="/run/kibana.pid"
+KIBANA_USER=${KIBANA_USER:="kibana"}
+
+depend() {
+ need elasticsearch
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+
+ checkpath -d -o "${KIBANA_USER}" -m750 "/var/log/kibana"
+
+ start-stop-daemon --start \
+ --user $KIBANA_USER \
+ --background \
+ --make-pidfile \
+ --pidfile $pidfile \
+ --stdout /var/log/kibana/kibana.log \
+ --stderr /var/log/kibana/kibana.err \
+ --exec $command
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+
+ start-stop-daemon --stop \
+ --pidfile $pidfile
+
+
+ eend $?
+}