diff options
Diffstat (limited to 'net-analyzer/munin/files/munin-node_init.d_1.4.6-r2')
-rw-r--r-- | net-analyzer/munin/files/munin-node_init.d_1.4.6-r2 | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/net-analyzer/munin/files/munin-node_init.d_1.4.6-r2 b/net-analyzer/munin/files/munin-node_init.d_1.4.6-r2 new file mode 100644 index 000000000000..409570d441ba --- /dev/null +++ b/net-analyzer/munin/files/munin-node_init.d_1.4.6-r2 @@ -0,0 +1,41 @@ +#!/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: |