1 |
jlec 12/07/07 07:21:50 |
2 |
|
3 |
Added: munin-node_init.d_1.4.7 |
4 |
Log: |
5 |
Add fix when /var/run is on tmpfs |
6 |
|
7 |
(Portage version: 2.2.0_alpha116/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-analyzer/munin/files/munin-node_init.d_1.4.7 |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/files/munin-node_init.d_1.4.7?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/munin/files/munin-node_init.d_1.4.7?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: munin-node_init.d_1.4.7 |
16 |
=================================================================== |
17 |
#!/sbin/runscript |
18 |
# Copyright 1999-2012 Gentoo Foundation |
19 |
# Distributed under the terms of the GNU General Public License v2 |
20 |
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/files/munin-node_init.d_1.4.7,v 1.1 2012/07/07 07:21:50 jlec Exp $ |
21 |
|
22 |
get_munin_config() { |
23 |
awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE" |
24 |
} |
25 |
|
26 |
: ${NAME:="munin-node"} |
27 |
: ${CFGFILE:=/etc/munin/munin-node.conf} |
28 |
: ${PIDFILE:=$(get_munin_config pid_file)} |
29 |
: ${NICE_LEVEL:=0} |
30 |
|
31 |
fix_dirs() { |
32 |
local rundir piddir |
33 |
piddir=$(dirname ${PIDFILE}) |
34 |
rundir="/var/run/munin/plugin-state /var/run/munin/spool" |
35 |
for dir in ${piddir} ${rundir}; do |
36 |
[ -d ${dir} ] || mkdir -p ${dir} |
37 |
chown munin:munin ${dir} |
38 |
done |
39 |
} |
40 |
|
41 |
depend() { |
42 |
config "$CFGFILE" |
43 |
|
44 |
need net |
45 |
before cron |
46 |
|
47 |
[ "$(get_munin_config log_file)" == "Sys::Syslog" ] && \ |
48 |
use logger |
49 |
} |
50 |
|
51 |
start() { |
52 |
fix_dirs |
53 |
|
54 |
ebegin "Starting $NAME" |
55 |
start-stop-daemon --nicelevel $NICE_LEVEL --start --pidfile $PIDFILE --exec /usr/sbin/$NAME -- \ |
56 |
--config "$CFGFILE" |
57 |
eend $? |
58 |
} |
59 |
|
60 |
stop() { |
61 |
ebegin "Stopping $NAME" |
62 |
start-stop-daemon --stop --pidfile $PIDFILE |
63 |
eend $? |
64 |
} |
65 |
|
66 |
# vim: filetype=gentoo-init-d: |