Permalink
Browse files

master: make it possible to configure the default cgi-tmp directory.

This allows distributions to use, for instance, /var/cache/munin-cgi,
so that /var/lib preserves its designed purpose.
  • Loading branch information...
1 parent 3ae38b5 commit 50f49fa2ce8777c56fc802e680523c688d6dcfc6 @Flameeyes Flameeyes committed Nov 4, 2012
View
@@ -88,14 +88,14 @@ install-master-prime: $(INFILES_MASTER) install-pre install-master
mkdir -p $(PERLLIB)/Munin/Master
mkdir -p $(HTMLDIR)
mkdir -p $(DBDIR)
- mkdir -p $(DBDIR)/cgi-tmp
+ mkdir -p $(CGITMPDIR)
mkdir -p $(CGIDIR)
$(CHOWN) $(USER) $(HTMLDIR) $(DBDIR)
$(CHMOD) 0755 $(DBDIR)
- $(CHOWN) $(CGIUSER) $(DBDIR)/cgi-tmp
- $(CHMOD) 0755 $(DBDIR)/cgi-tmp
+ $(CHOWN) $(CGIUSER) $(CGITMPDIR)
+ $(CHMOD) 0755 $(CGITMPDIR)
for p in master/www/*.tmpl ; do \
$(INSTALL) -m 0644 "$$p" $(CONFDIR)/templates/ ; \
@@ -281,6 +281,7 @@ common/blib/lib/Munin/Common/Defaults.pm: common/lib/Munin/Common/Defaults.pm bu
s{(VERSION \s+=\s).*}{\1q{$(VERSION)};}x; \
s{(PLUGSTATE \s+=\s).*}{\1q{$(PLUGSTATE)};}x; \
s{(CGIDIR \s+=\s).*}{\1q{$(CGIDIR)};}x; \
+ s{(CGITMPDIR \s+=\s).*}{\1q{$(CGITMPDIR)};}x; \
s{(USER \s+=\s).*}{\1q{$(USER)};}x; \
s{(GROUP \s+=\s).*}{\1q{$(GROUP)};}x; \
s{(PLUGINUSER \s+=\s).*}{\1q{$(PLUGINUSER)};}x; \
View
@@ -44,6 +44,9 @@ CGIDIR = $(PREFIX)/www/cgi
# Where to put internal data for master (RRD, internal files, ...)
DBDIR = $(DESTDIR)/var/opt/munin
+# Where to put CGI cached files (for master only)
+CGITMPDIR = $(DBDIR)/cgi-tmp
+
# Where to put internal data for node (plugin state, ...)
DBDIRNODE = $(DESTDIR)/var/opt/munin-node
@@ -25,7 +25,7 @@ our $MUNIN_DOCDIR = '';
our $MUNIN_LIBDIR = '';
our $MUNIN_HTMLDIR = '';
our $MUNIN_CGIDIR = '';
-our $MUNIN_CGITMPDIR = '';
+our $MUNIN_CGITMPDIR = '';
our $MUNIN_DBDIR = '';
our $MUNIN_PLUGSTATE = '';
our $MUNIN_SPOOLDIR = '';
@@ -333,7 +333,7 @@ sub get_picture_filename {
my $params = shift;
# XXX - hack to fix cgitmpdir default
- $config->{cgitmpdir} ||= "$Munin::Common::Defaults::MUNIN_DBDIR/cgi-tmp";
+ $config->{cgitmpdir} ||= "$Munin::Common::Defaults::MUNIN_CGITMPDIR";
my $cgi_tmp_dir = $config->{cgitmpdir} . "/munin-cgi-graph";
$params = $params ? "?$params" : "";
@@ -156,7 +156,7 @@ my %booleans = map {$_ => 1} qw(
tls_verify_depth => 5,
tmpldir => "$Munin::Common::Defaults::MUNIN_CONFDIR/templates",
staticdir => "$Munin::Common::Defaults::MUNIN_CONFDIR/static",
- cgitmpdir => "$Munin::Common::Defaults::MUNIN_DBDIR/cgi-tmp",
+ cgitmpdir => "$Munin::Common::Defaults::MUNIN_CGITMPDIR",
}, $class ),
oldconfig => bless ( {
View
@@ -21,7 +21,7 @@
# temporary cgi files are here. note that it has to be writable by
# the cgi user (usually nobody or httpd).
#
-# cgitmpdir @@DBDIR@@/cgi-tmp
+# cgitmpdir @@CGITMPDIR@@
# (Exactly one) directory to include all files from.
includedir @@CONFDIR@@/munin-conf.d

0 comments on commit 50f49fa

Please sign in to comment.