#!/bin/sh # $FreeBSD$ # PROVIDE: grafana2 # REQUIRE: DAEMON NETWORKING # BEFORE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable grafana2b: # grafana2_enable="YES" # # grafana2_enable (bool): Set to YES to enable grafana2 # Default: NO # grafana2_ini (str): grafana2 configuration file # Default: ${PREFIX}/etc/grafana2.conf # grafana2_user (str): grafana2 daemon user # Default: grafana2 # grafana2_group (str): grafana2 daemon group # Default: grafana2 # grafana2_flags (str): Extra flags passed to grafana2 . /etc/rc.subr name="grafana2" rcvar=grafana2_enable : ${grafana2_enable:="NO"} : ${grafana2_homepath:="%%GRAFANA_HOMEDIR%%"} : ${grafana2_user:="%%GRAFANA_USER%%"} : ${grafana2_group:="%%GRAFANA_GROUP%%"} : ${grafana2_flags:=""} : ${grafana2_ini:="%%PREFIX%%/etc/${name}.ini"} : ${grafana2_options:="${grafana2b_flags} -homepath=${grafana2_homepath} -config=${grafana2_ini}"} # daemon grafana2_pidfile="%%GRAFANA_PIDFILE%%" procname="%%PREFIX%%/bin/${name}" command=/usr/sbin/daemon command_args=" -f -c -p ${grafana2_pidfile} sh -c \\\"${procname} ${grafana2_options} 2>&1| logger -t ${name}\\\"" start_precmd="grafana2_precmd" grafana2_precmd() { install -o ${grafana2_user} /dev/null ${grafana2_pidfile} } load_rc_config $name run_rc_command "$1"