#!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ depend() { use lm_sensors logger after mysql } pidfile() { [[ -f "$1" ]] && awk '$1 == "PIDFile" { print $2; }' "$1" } start() { if [[ "${NETWORK_MODE}" = yes ]]; then if [[ "${ENABLE_SERVER}" = yes ]]; then ebegin "Starting collectd server" /usr/sbin/collectd -C ${SERVER_CONFIG:-/etc/collectd-server.conf} eend $? fi ebegin "Starting collectd client" /usr/sbin/collectd ${CLIENT_CONFIG:+-C ${CLIENT_CONFIG}} eend $? else ebegin "Starting local collectd client" /usr/sbin/collectd ${CLIENT_CONFIG:+-C ${CLIENT_CONFIG}} eend $? fi } stop() { if [[ "${NETWORK_MODE}" = yes ]]; then if [[ "${ENABLE_SERVER}" = yes ]]; then ebegin "Stopping collectd server" /sbin/start-stop-daemon --quiet --stop --pidfile $(pidfile ${SERVER_CONFIG:-/etc/collectd-server.conf}); eend $? fi fi ebegin "Stopping collectd client" /sbin/start-stop-daemon --quiet --stop --pidfile $(pidfile ${CLIENT_CONFIG:-/etc/collectd.conf}); eend $? }