30 lines
795 B
Plaintext
30 lines
795 B
Plaintext
#!/sbin/openrc-run
|
|
# Copyright 1999-2022 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
description="The open-source platform for monitoring and observability"
|
|
|
|
: ${GRAFANA_USER:=grafana}
|
|
: ${GRAFANA_DATADIR:=/var/lib/~PN_S~}
|
|
: ${GRAFANA_LOGDIR:=/var/log/~PN_S~}
|
|
: ${GRAFANA_TERMTIMEOUT:="TERM/20/KILL/5"}
|
|
: ${SSD_OPTS:="-d /usr/share/~PN_S~ -w 1000"}
|
|
|
|
name="Grafana"
|
|
command="/usr/bin/~PN_S~-server"
|
|
command_args="${GRAFANA_OPTS}"
|
|
command_user="${GRAFANA_USER}"
|
|
command_background=true
|
|
pidfile="/run/${SVCNAME}.pid"
|
|
required_files="${GRAFANA_CONFIG}"
|
|
retry="${GRAFANA_TERMTIMEOUT}"
|
|
start_stop_daemon_args="${SSD_OPTS}"
|
|
|
|
depend() {
|
|
need localmount net
|
|
}
|
|
|
|
start_pre() {
|
|
checkpath -d -m 0750 -o "${GRAFANA_USER}" "${GRAFANA_DATADIR}" "${GRAFANA_LOGDIR}"
|
|
}
|