freebsd-ports/net-mgmt/collectd/files/collectd.in
Tim Bishop cf849cc8c7 - Stage support
- USES=libtool
- Use new LIB_DEPENDS format
- Create database directory during startup rather than in the package

PR:		ports/189769
Submitted by:	Krzysztof Stryjek <ports@bsdserwis.com>
2014-05-23 19:32:36 +00:00

36 lines
665 B
Bash

#!/bin/sh
# PROVIDE: collectd
# REQUIRE: LOGIN
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# collectd_enable (bool): Set to NO by default.
# Set it to YES to enable collectd.
# collectd_flags (string): Set to "" by default.
# Additional flags to collectd, see manual page.
#
. /etc/rc.subr
name="collectd"
rcvar=collectd_enable
command=%%PREFIX%%/sbin/${name}
_dbdir=/var/db/collectd
start_precmd="collectdmon_prepcmd"
load_rc_config $name
: ${collectd_enable="NO"}
collectdmon_prepcmd()
{
if [ ! -d ${_dbdir} ] ; then
mkdir -p ${_dbdir}
fi
}
run_rc_command "$1"