31 lines
		
	
	
		
			801 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			801 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
#!/sbin/openrc-run
 | 
						|
# Copyright 1999-2025 Gentoo Authors
 | 
						|
# 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:="-w 1000"}
 | 
						|
 | 
						|
name="Grafana"
 | 
						|
command="/usr/bin/~PN_S~-server"
 | 
						|
command_args="${GRAFANA_OPTS}"
 | 
						|
command_user="${GRAFANA_USER}"
 | 
						|
command_background=true
 | 
						|
directory="/usr/share/~PN_S~"
 | 
						|
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}"
 | 
						|
}
 |