diff --git a/databases/py-carbon/Makefile b/databases/py-carbon/Makefile index 403748ab5e0f..5ec19b8ffa72 100644 --- a/databases/py-carbon/Makefile +++ b/databases/py-carbon/Makefile @@ -1,46 +1,46 @@ # Created by: Evan Sarmiento PORTNAME= carbon PORTVERSION= 1.1.10 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= databases python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= bofh@FreeBSD.org COMMENT= Backend storage application for graphite LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cachetools>=1.1.0:devel/py-cachetools@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}service_identity>=0:security/py-service_identity@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}twisted>=13.2.0:devel/py-twisted@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}txamqp>=0.3:net/py-txamqp@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}urllib3>=0:net/py-urllib3@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}whisper>=0.9.10:databases/py-whisper@${PY_FLAVOR} USES= python USE_GITHUB= yes GH_ACCOUNT= graphite-project USE_PYTHON= distutils py3kplist USE_RC_SUBR= carbon MAKE_ENV= GRAPHITE_NO_PREFIX=yes NO_ARCH= yes SUB_LIST= PYTHON_CMD=${PYTHON_CMD} .include .if ${PYTHON_REL} > 30900 BROKEN= Python-3.9 is not supported .endif post-patch: @${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/setup.py post-install: ${RM} -r ${STAGEDIR}${PREFIX}/examples/init.d ${RMDIR} ${STAGEDIR}${PREFIX}/examples .include diff --git a/databases/py-carbon/files/carbon.in b/databases/py-carbon/files/carbon.in index edc4535df7f2..a3f98eae28eb 100644 --- a/databases/py-carbon/files/carbon.in +++ b/databases/py-carbon/files/carbon.in @@ -1,117 +1,117 @@ #!/bin/sh # PROVIDE: carbon +# REQUIRE: LOGIN # KEYWORD: shutdown -# +# # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # carbon_enable (bool): Set to NO by default. # Set it to YES to enable it. # carbon_as_relay (bool): Set to NO by default (start cache). # Set it to YES to run as RELAY. # carbon_instances: Empty by default (start single instance). # Space-separated list of instances to start. # carbon_conf: File where carbon configuration resides # Default: %%PREFIX%%/etc/carbon/carbon.conf # carbon_relay_rules: File where carbon relay rules resides # Default: %%PREFIX%%/etc/carbon/relay-rules.conf # carbon_user: The user account carbon daemon runs as what # you want it to be. It uses 'root' user by # default. # carbon_group: The group account carbon daemon runs as what # you want it to be. It uses 'wheel' group by # default. # carbon_debug: Determines if you want carbon to run in debug # mode, it may be very verbose. It will not run # in debug by default. # carbon_logdir: Directory where carbon logs are stored. # Default: /var/db/carbon/log -# +# . /etc/rc.subr name=carbon rcvar=carbon_enable load_rc_config ${name} : ${carbon_enable:=NO} : ${carbon_as_relay:=NO} : ${carbon_instances:=""} : ${carbon_user:=root} : ${carbon_group:=wheel} : ${carbon_conf:=%%PREFIX%%/etc/carbon/carbon.conf} : ${carbon_relay_rules:=%%PREFIX%%/etc/carbon/relay-rules.conf} : ${carbon_debug:=NO} : ${carbon_logdir:=/var/db/carbon/log/} : ${carbon_pidfile:=/var/run/carbon.pid} is_carbon_instance() { local instance for instance in ${carbon_instances}; do if [ "${instance}" = "$1" ]; then return 0 fi done return 1 } if [ -n "${carbon_instances}" ]; then if [ -n "$2" ]; then instance="$2" if ! is_carbon_instance ${instance}; then echo "$0: no such instance defined in carbon_instances." exit 1 fi instance_arg="--instance=${instance}" eval carbon_user=\${carbon_${instance}_user:-"${carbon_user}"} eval carbon_group=\${carbon_${instance}_group:-"${carbon_group}"} eval carbon_conf=\${carbon_${instance}_conf:-"${carbon_conf}"} eval carbon_relay_rules=\${carbon_${instance}_relay_rules:-"${carbon_relay_rules}"} eval carbon_debug=\${carbon_${instance}_debug:-"${carbon_debug}"} eval carbon_logdir=\${carbon_${instance}_logdir:-"${carbon_logdir}"} eval carbon_pidfile=\${carbon_${instance}_pidfile:-"/var/run/carbon-${instance}.pid"} elif [ -n "$1" ]; then for instance in ${carbon_instances}; do echo "Processing carbon instance: ${instance}" /usr/local/etc/rc.d/carbon $1 ${instance} done exit 0 fi fi is_carbon_relay() { if [ "${carbon_as_relay}" = "YES" ]; then return 0 fi return 1 } stop_cmd="${name}_stop" required_files="${carbon_conf} %%PREFIX%%/etc/carbon/storage-schemas.conf" pidfile=${carbon_pidfile} command_interpreter="%%PYTHON_CMD%%" if is_carbon_relay; then command="%%PREFIX%%/bin/carbon-relay.py" rules_arg="--rules ${carbon_relay_rules}" else command="%%PREFIX%%/bin/carbon-cache.py" rules_arg="" fi command_args="--config=${carbon_conf} ${instance_arg} --logdir ${carbon_logdir} --pidfile ${pidfile} ${rules_arg} start" carbon_stop() { echo "Stopping $name" pids=`check_pidfile ${pidfile} ${command} ${command_interpreter}` ${command} --config=${carbon_conf} ${instance_arg} --pidfile ${pidfile} stop wait_for_pids ${pids} } run_rc_command "$1" -