diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /www-apps/grafana-bin/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'www-apps/grafana-bin/files')
-rw-r--r-- | www-apps/grafana-bin/files/grafana.confd | 7 | ||||
-rw-r--r-- | www-apps/grafana-bin/files/grafana.initd.3 | 38 | ||||
-rw-r--r-- | www-apps/grafana-bin/files/grafana.service | 24 |
3 files changed, 69 insertions, 0 deletions
diff --git a/www-apps/grafana-bin/files/grafana.confd b/www-apps/grafana-bin/files/grafana.confd new file mode 100644 index 000000000000..207ef765f653 --- /dev/null +++ b/www-apps/grafana-bin/files/grafana.confd @@ -0,0 +1,7 @@ +# Config file for /etc/init.d/grafana + +# The user to run your application as. +GRAFANA_USER=grafana + +# The group to run your application as. +GRAFANA_GROUP=grafana diff --git a/www-apps/grafana-bin/files/grafana.initd.3 b/www-apps/grafana-bin/files/grafana.initd.3 new file mode 100644 index 000000000000..c454fb249753 --- /dev/null +++ b/www-apps/grafana-bin/files/grafana.initd.3 @@ -0,0 +1,38 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need localmount +} + +start() { + ebegin "Starting grafana server" + + checkpath -d -o "${GRAFANA_USER}:${GRAFANA_GROUP}" -m750 "/var/lib/grafana/dashboards" + checkpath -d -o "${GRAFANA_USER}:${GRAFANA_GROUP}" -m750 "/var/lib/grafana/plugins" + checkpath -d -o "${GRAFANA_USER}:${GRAFANA_GROUP}" -m750 "/var/lib/grafana/sessions" + + 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/files/grafana.service b/www-apps/grafana-bin/files/grafana.service new file mode 100644 index 000000000000..66fefe67e3ee --- /dev/null +++ b/www-apps/grafana-bin/files/grafana.service @@ -0,0 +1,24 @@ +[Unit] +Description=Grafana +Documentation=http://docs.grafana.org +Wants=network-online.target +After=network-online.target + +[Service] +User=grafana +Group=grafana +Type=simple +Restart=on-failure +WorkingDirectory=/usr/share/grafana +ExecStart=/usr/bin/grafana-server \ + --config=/etc/grafana/grafana.ini \ + --pidfile=/run/grafana.pid \ + cfg:default.paths.logs=/var/log/grafana \ + cfg:default.paths.data=/var/lib/grafana \ + cfg:default.paths.plugins=/var/lib/grafana/plugins +LimitNOFILE=10000 +TimeoutStopSec=20 +UMask=0027 + +[Install] +WantedBy=multi-user.target |