From bf985688beeed2958d059c99935af10f84374810 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Sun, 3 May 2015 19:59:03 +0000 Subject: grafana --- www/grafana2/files/grafana2.in | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 www/grafana2/files/grafana2.in (limited to 'www/grafana2/files/grafana2.in') diff --git a/www/grafana2/files/grafana2.in b/www/grafana2/files/grafana2.in new file mode 100644 index 0000000..2ef263c --- /dev/null +++ b/www/grafana2/files/grafana2.in @@ -0,0 +1,48 @@ +#!/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" -- cgit v1.2.1