#!/sbin/runscript # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/files/munin-node_init.d_1.4.6-r2,v 1.1 2011/08/17 15:45:54 darkside Exp $ get_munin_config() { awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE" } : ${NAME:="munin-node"} : ${CFGFILE:=/etc/munin/munin-node.conf} : ${PIDFILE:=$(get_munin_config pid_file)} : ${NICE_LEVEL:=0} depend() { config "$CFGFILE" need net before cron [ "$(get_munin_config log_file)" == "Sys::Syslog" ] && \ use logger } start() { local piddir=$(dirname ${PIDFILE}) [ -d ${piddir} ] || mkdir -p ${piddir} ebegin "Starting $NAME" start-stop-daemon --nicelevel $NICE_LEVEL --start --pidfile $PIDFILE --exec /usr/sbin/$NAME -- \ --config "$CFGFILE" eend $? } stop() { ebegin "Stopping $NAME" start-stop-daemon --stop --pidfile $PIDFILE eend $? } # vim: filetype=gentoo-init-d: