Package: munin
Version: 1.4.5-2
Severity: normal
Tags: upstream patch
Hi,
I just stumbled over the following nasty inconvenience:
- cgi-graphing enabled
- www-data is member of group munin, so for cgi graphing to work the cache
dirs need to be group writeable
- added new node to be monitored
- on first run of munin-cron (and munin-html) the cache dir for the new node
was created with the hard-coded mode of 755 wich subsequently lead to empty
graphs in munin-cgi-graph
So instead of having to change the dir modes on every node addition, I wrote
the attached patch, which makes the mode of directories created by munin-html
configurable by an entry in /etc/munin/munin-node.conf, e.g.
htmldir_mode 775
If that line is missing, the $htmldir_mode variable will be initialized with
the former default value of 755. Additionally, the keyword htmldir_mode is
added as a legal config keyword in Common/Config.pm
Cheers,
Daniel
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (990, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.35.7-1-amd64-dhr (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF8, LC_CTYPE=en_US.UTF8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages munin depends on:
ii adduser 3.112 add and remove users and groups
ii cron 3.0pl1-114 process scheduling daemon
pn libdigest-md5-perl <none> (no description available)
ii libhtml-template-perl 2.9-2 module for using HTML Templates wi
ii liblog-log4perl-perl 1.29-1 A Perl port of the widely popular
ii libparse-recdescent-perl 1.965001+dfsg-1 Perl module to create and use recu
ii librrds-perl 1.4.3-1 time-series data storage and displ
pn libstorable-perl <none> (no description available)
ii munin-common 1.4.5-2 network-wide graphing framework (c
ii perl [libtime-hires-perl 5.10.1-14 Larry Wall's Practical Extraction
ii perl-modules 5.10.1-14 Core Perl modules
ii rrdtool 1.4.3-1 time-series data storage and displ
ii ttf-dejavu 2.31-1 Metapackage to pull in ttf-dejavu-
Versions of packages munin recommends:
ii libdate-manip-perl 6.11-1 module for manipulating dates
ii munin-node 1.4.5-2 network-wide graphing framework (n
Versions of packages munin suggests:
ii apache2-mpm-itk [httpd] 2.2.16-2 multiuser MPM for Apache 2.2
ii elinks [www-browser] 0.12~pre5-2 advanced text-mode WWW browser
ii epiphany-browser [www-browse 2.30.6-1 Intuitive GNOME web browser
ii iceweasel [www-browser] 3.5.13-1 Web browser based on Firefox
ii libnet-ssleay-perl 1.36-1 Perl module for Secure Sockets Lay
ii w3m [www-browser] 0.5.2-9 WWW browsable pager with excellent
--- /usr/share/perl5/Munin/Common/Config.pm 2010-08-23 17:47:58.000000000
+0200
+++ /usr/share/perl5/Munin/Common/Config.pm.myutils-new 2010-10-01
16:52:29.751931683 +0200
@@ -37,6 +37,7 @@
"cdef_name", "graphable", "process", "realname",
"onlynullcdef", "group_order", "pipe", "pipe_command",
"unknown_limit", "num_unknowns", "dropdownlimit",
+ "htmldir_mode",
"max_graph_jobs", "max_cgi_graph_jobs", "munin_cgi_graph_jobs" );
my %bools = map { $_ => 1} qw(yes no true false on off 1 0);
--- /usr/share/perl5/Munin/Master/HTMLOld.pm 2010-08-23 17:47:57.000000000
+0200
+++ /usr/share/perl5/Munin/Master/HTMLOld.pm.myutils-new 2010-10-01
16:52:51.936699524 +0200
@@ -87,6 +87,7 @@
my %comparisontemplates;
my $tmpldir;
my $htmldir;
+my $htmldir_mode = 755;
my $do_dump = 0;
my $do_fork = 0; # No effect in this program.
@@ -121,6 +122,9 @@
$tmpldir = $config->{tmpldir};
$htmldir = $config->{htmldir};
+ if (defined $config->{'htmldir_mode'}) {
+ $htmldir_mode = $config->{'htmldir_mode'};
+ }
%comparisontemplates = instanciate_comparison_templates($tmpldir);
@@ -359,7 +363,7 @@
$dirname =~ s/\/[^\/]*$//;
DEBUG "[DEBUG] Creating service page $filename";
- munin_mkdir_p($dirname, oct(755));
+ munin_mkdir_p($dirname, oct($htmldir_mode));
open(my $FILE, '>', $filename)
or die "Cannot open '$filename' for writing: $!";