diff options
author | Yves Fischer <yvesf+git@xapek.org> | 2015-05-03 21:30:38 +0000 |
---|---|---|
committer | Charlie Root <root@db.2.localnet.cc> | 2015-05-03 21:31:19 +0000 |
commit | e3120d2ae02090f820f0b00f657c5fd80877a1a1 (patch) | |
tree | 320b2aaf6b7f9ff3c32cfec631a91b42cb25a120 /databases/influxdb/files | |
download | freebsd-ports-influxdb-e3120d2ae02090f820f0b00f657c5fd80877a1a1.tar.gz freebsd-ports-influxdb-e3120d2ae02090f820f0b00f657c5fd80877a1a1.zip |
add influxdb from cheffo/FreeBSD-Ports
Diffstat (limited to 'databases/influxdb/files')
-rw-r--r-- | databases/influxdb/files/influxd.in | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/databases/influxdb/files/influxd.in b/databases/influxdb/files/influxd.in new file mode 100644 index 0000000..75c693b --- /dev/null +++ b/databases/influxdb/files/influxd.in @@ -0,0 +1,47 @@ +#!/bin/sh +# $FreeBSD$ + +# PROVIDE: influxd +# REQUIRE: DAEMON NETWORKING +# BEFORE: LOGIN +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable influxdb: +# influxd_enable="YES" +# +# influxd_enable (bool): Set to YES to enable influxd +# Default: NO +# influxd_conf (str): influxd configuration file +# Default: ${PREFIX}/etc/influxd.conf +# influxd_user (str): influxd daemon user +# Default: influxd +# influxd_group (str): influxd daemon group +# Default: influxd +# influxd_flags (str): Extra flags passed to influxd + +. /etc/rc.subr + +name="influxd" +rcvar=influxd_enable + +: ${influxd_enable:="NO"} +: ${influxd_user:="%%INFLUXD_USER%%"} +: ${influxd_group:="%%INFLUXD_GROUP%%"} +: ${influxd_flags:=""} +: ${influxd_conf:="%%PREFIX%%/etc/${name}.conf"} +: ${influxd_options:="${influxdb_flags} -config=${influxd_conf}"} + +# daemon +influxd_pidfile="%%INFLUXD_PIDDIR%%${name}.pid" +procname="%%PREFIX%%/bin/${name}" +command=/usr/sbin/daemon +command_args=" -f -c -p ${influxd_pidfile} sh -c \\\"${procname} ${influxd_options} 2>&1| logger -t ${name}\\\"" +start_precmd="influxd_precmd" + +influxd_precmd() +{ + install -o ${influxd_user} /dev/null ${influxd_pidfile} +} + +load_rc_config $name +run_rc_command "$1" |