grobian     15/05/05 14:44:31

  Added:                carbon-c-relay.confd carbon-c-relay.initd
  Log:
  Revbump for introduction of init-script
  
  (Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 
0x5F75F607C5C74E89)

Revision  Changes    Path
1.1                  app-misc/carbon-c-relay/files/carbon-c-relay.confd

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/carbon-c-relay/files/carbon-c-relay.confd?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/carbon-c-relay/files/carbon-c-relay.confd?rev=1.1&content-type=text/plain

Index: carbon-c-relay.confd
===================================================================
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: 
/var/cvsroot/gentoo-x86/app-misc/carbon-c-relay/files/carbon-c-relay.confd,v 
1.1 2015/05/05 14:44:31 grobian Exp $

# routing file to read
#ROUTES_FILE=/etc/carbon-c-relay.conf

# where to store the PID-file
#PIDFILE=/run/carbon-c-relay.pid

# user and group to run carbon-c-relay as
#USER=carbon
#GROUP=carbon

# any options to use when starting the relay
#EXTRA_OPTS=



1.1                  app-misc/carbon-c-relay/files/carbon-c-relay.initd

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/carbon-c-relay/files/carbon-c-relay.initd?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/carbon-c-relay/files/carbon-c-relay.initd?rev=1.1&content-type=text/plain

Index: carbon-c-relay.initd
===================================================================
#!/sbin/runscript
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: 
/var/cvsroot/gentoo-x86/app-misc/carbon-c-relay/files/carbon-c-relay.initd,v 
1.1 2015/05/05 14:44:31 grobian Exp $

extra_commands="configtest"
extra_started_commands="reload"

description="Lightweight graphite metrics router and aggregator."
description_configtest="Run carbon-c-relay's internal config check."
description_reload="Reload the carbon-c-relay configuration without losing 
connections."

routes_config=${ROUTES_FILE:-/etc/${SVCNAME}.conf}

command="/usr/bin/carbon-c-relay"
command_args="-f ${routes_config} ${EXTRA_OPTS}"
pidfile=${PIDFILE:-/run/${SVCNAME}.pid}
user=${USER:-carbon}
group=${GROUP:-carbon}

depend() {
        need net
        use dns
}

start_pre() {
        if [ "${RC_CMD}" != "restart" ]; then
                configtest || return 1
        fi
}

stop_pre() {
        if [ "${RC_CMD}" = "restart" ]; then
                configtest || return 1
        fi
}

stop_post() {
        rm -f ${pidfile}
}

start() {
        ebegin "Starting ${SVCNAME}"
        start-stop-daemon --start --background --make-pidfile --pidfile 
${pidfile} \
                --stdout /var/log/${SVCNAME}.log --stderr /dev/stdout \
                --user ${user} --group ${group} \
                --exec ${command} -- ${command_args}
        eend $?
}

stop() {
        ebegin "Stopping ${SVCNAME}"
        start-stop-daemon --stop --exec ${command} --pidfile ${pidfile}
        eend $?
}

reload() {
        configtest || return 1
        ebegin "Refreshing ${SVCNAME}'s configuration"
        kill -HUP $(< ${pidfile}) &>/dev/null
        eend $? "Failed to reload ${SVCNAME}"
}

configtest() {
        ebegin "Checking ${SVCNAME}'s configuration"
        ${command} -f "${routes_config}" -t < /dev/null > /dev/null
        eend $? "failed, please correct errors above"
}




Reply via email to