Hello!

This patch updates munin to 2.0.19 and adds some improvements:
 - unbreak munin-check script and make it useful (it's for checking permissions)
   Haven't tested fixing mode yet, only checks.
 - move a note of newsyslog.conf fragment for munin-node.log to README-main
 - add missing { in README-server
 - instructions about reducing disk I/O with rrdcached.

After this is in, I'm going to test munin with nginx and add notes and
examples to README.
OK to commit?
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/munin/Makefile,v
retrieving revision 1.37
diff -u -p -r1.37 Makefile
--- Makefile	15 Jan 2014 08:24:25 -0000	1.37
+++ Makefile	15 Feb 2014 15:33:33 -0000
@@ -3,8 +3,7 @@
 COMMENT-main =	flexible network host monitoring, client
 COMMENT-server =flexible network host monitoring, server
 
-V =		2.0.18
-REVISION =	0
+V =		2.0.19
 DISTNAME =	munin-$V
 PKGNAME-main =	munin-node-$V
 PKGNAME-server =munin-server-$V
@@ -54,7 +53,8 @@ MAKE_ENV +=		CONFDIR=${SYSCONFDIR}/munin
 			OSTYPE=openbsd \
 			PREFIX=${PREFIX} \
 			PYTHON=${MODPY_BIN}
-MAKE_FLAGS +=		BASH=${LOCALBASE}/bin/bash
+MAKE_FLAGS +=		BASH=${LOCALBASE}/bin/bash \
+			PLUGINUSER=_munin-plugin
 
 FAKE_FLAGS +=		HTMLDIR=${WRKINST}/${PREFIX}/share/examples/munin/www \
 			CGIDIR=${WRKINST}/${PREFIX}/share/examples/munin/www \
Index: distinfo
===================================================================
RCS file: /cvs/ports/net/munin/distinfo,v
retrieving revision 1.11
diff -u -p -r1.11 distinfo
--- distinfo	3 Dec 2013 10:21:01 -0000	1.11
+++ distinfo	15 Feb 2014 15:33:33 -0000
@@ -1,2 +1,2 @@
-SHA256 (munin-2.0.18.tar.gz) = ahi/9rEvj4JV1NuWK+lCjFz+en1Z0ZjAWGBnwUwTwHs=
-SIZE (munin-2.0.18.tar.gz) = 1335160
+SHA256 (munin-2.0.19.tar.gz) = E9ubANQyuSkH1h+fK9GMKq/KA7Km4lciL/8Xqk7QKJY=
+SIZE (munin-2.0.19.tar.gz) = 1335496
Index: patches/patch-master__bin_munin-check_in
===================================================================
RCS file: patches/patch-master__bin_munin-check_in
diff -N patches/patch-master__bin_munin-check_in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-master__bin_munin-check_in	15 Feb 2014 15:33:33 -0000
@@ -0,0 +1,107 @@
+$OpenBSD$
+--- master/_bin/munin-check.in.orig	Sat Dec  7 14:55:16 2013
++++ master/_bin/munin-check.in	Sat Feb 15 19:23:30 2014
+@@ -1,4 +1,4 @@
+-#!@@BASH@@
++#!@@GOODSH@@
+ # -*- sh -*-
+ # Copyright (C) 2008 Matthias Schmitz
+ # This program is free software; you can redistribute it and/or
+@@ -20,20 +20,17 @@
+ 
+ ####
+ # prints usage
+-function usage() {
++function usage {
+     echo "Usage: munin-check [options]
+ Options:
+-   -h|--help		Show this help.
+-   -f|--fix-permissions Fix the permissions of the munin dirs and files.
+-   			Needs superuser rights.
+-
+-Please don't use this script if you are using 'graph_strategy cgi'!
+-It doesn't care about the right permissions for www-data yet...
++   -h		Show this help.
++   -f		Fix the permissions of the munin dirs and files.
++   		Needs superuser rights.
+ "
+ }
+ 
+ # Get options from the command line
+-TEMP=$(getopt -o fh --long fix-permissions,help -n 'munin-check' -- "$@")
++TEMP=$(getopt fh $*)
+ 
+ if [[ $? -ne 0 ]]; then
+     echo "Terminating..." >&2
+@@ -45,8 +42,8 @@ eval set -- "$TEMP"
+ 
+ while :; do
+     case "$1" in
+-	-h|--help) usage ; exit 0; shift ;;
+-	-f|--fix-permissions) PLEASE_FIXME="true" ;  shift ;;
++	-h) usage ; exit 0; shift ;;
++	-f) PLEASE_FIXME="true" ;  shift ;;
+ 	--) shift ; break ;;
+ 	*) echo "Internal error!" ; exit 1 ;;
+     esac
+@@ -54,7 +51,7 @@ done
+ 
+ ####
+ # sets owner to "@@USER@@"
+-function fix_owner() {
++function fix_owner {
+     fix_object=$1; shift
+     fix_owner=$1; shift
+ 
+@@ -72,7 +69,7 @@ function fix_owner() {
+ ####
+ # check if "@@USER@@" is owner, if PLEASE_FIXME set it calls fix_owner()
+ 
+-function owner_ok() {
++function owner_ok {
+     object=$1; shift || exit 1
+     correctowner=$1; shift || exit 1
+ 
+@@ -94,6 +91,11 @@ function owner_ok() {
+ 	    "lost+found") return 0;;
+ 	esac
+ 
++	# cgi-tmp owner should be www
++	case $object in
++	    "cgi-tmp") correctowner=www;
++	esac
++
+ 	# ... and then dive into it
+ 	for subobject in $object/*; do
+ 		owner_ok $subobject $correctowner
+@@ -102,7 +104,7 @@ function owner_ok() {
+ }
+ 
+ 
+-function perm_ok(){
++function perm_ok {
+     object=$1; shift || exit 1
+     correctperm=$1; shift || exit 1
+ 
+@@ -145,12 +147,20 @@ for dir in @@DBDIR@@/*; do
+ 	*/plugin-state)
+ 	    continue;;
+     esac
++    case $dir in
++	*/cgi-tmp)
++	    continue;;
++    esac
+     echo "check $dir"
+     owner_ok $dir @@USER@@
+ done
+ 
++echo "check @@DBDIR@@/cgi-tmp"
++owner_ok @@DBDIR@@/cgi-tmp www
++
+ echo "check miscellaneous"
+-norec=yes owner_ok @@LOGDIR@@ @@USER@@
++norec=yes owner_ok @@LOGDIR@@ @@PLUGINUSER@@
++norec=yes perm_ok @@LOGDIR@@ 775
+ 
+ norec=yes owner_ok @@DBDIR@@ @@USER@@
+ norec=yes perm_ok @@DBDIR@@ 755
Index: pkg/README-main
===================================================================
RCS file: /cvs/ports/net/munin/pkg/README-main,v
retrieving revision 1.1
diff -u -p -r1.1 README-main
--- pkg/README-main	22 Mar 2013 15:00:29 -0000	1.1
+++ pkg/README-main	15 Feb 2014 15:33:33 -0000
@@ -27,6 +27,10 @@ You can change permissions and ownership
 to run as a different user with the "user" option (see
 ${SYSCONFDIR}/munin/plugin-conf.d/openbsd-packages).
 
+Log files in /var/log/munin will need to be rotated. Here is a sample
+newsyslog.conf fragment:
+/var/log/munin/munin-node.log   root:wheel      644  7     250  *     Z
+
 SNMP-based monitors are also available; to use these, install the
 p5-Net-SNMP package.
 
Index: pkg/README-server
===================================================================
RCS file: /cvs/ports/net/munin/pkg/README-server,v
retrieving revision 1.3
diff -u -p -r1.3 README-server
--- pkg/README-server	15 Jan 2014 08:24:26 -0000	1.3
+++ pkg/README-server	15 Feb 2014 15:33:33 -0000
@@ -5,7 +5,7 @@ $OpenBSD: README-server,v 1.3 2014/01/15
 +-----------------------------------------------------------------------
 
 After configuring at least one munin-node instance and adapting
-$SYSCONFDIR}/munin/munin.conf as desired, you may run the periodic
+${SYSCONFDIR}/munin/munin.conf as desired, you may run the periodic
 tasks from cron with the following line:
 
 */5     *       *       *       *       sudo -u _munin ${TRUEPREFIX}/bin/munin-cron
@@ -16,5 +16,12 @@ newsyslog.conf fragment:
 /var/log/munin/munin-graph.log  _munin:_munin   644  7     250  *     Z
 /var/log/munin/munin-html.log   _munin:_munin   644  7     250  *     Z
 /var/log/munin/munin-limits.log _munin:_munin   644  7     250  *     Z
-/var/log/munin/munin-node.log   root:wheel      644  7     250  *     Z
 /var/log/munin/munin-update.log _munin:_munin   644  7     250  *     Z
+
+Optionally you may want to use rrdcached to reduce disk I/O. Here is a sample
+/etc/rc.conf.local part:
+rrdcached_flags="-b /var/db/munin -l unix:/var/run/munin/rrdcached.sock \
+-j /var/db/munin/journal -p /var/run/munin/rrdcached.pid \
+-m 0660 -s _munin -w 1800 -z 1800 -f 3600 -F"
+rrdcached_user="_munin"
+Add www user to _munin group to grant write permissions on rrdcached socket.

Reply via email to