diff options
Diffstat (limited to 'net-analyzer/munin/files')
5 files changed, 358 insertions, 0 deletions
diff --git a/net-analyzer/munin/files/patches/0002-build-create-an-install-minimal-target-that-only-ins.patch b/net-analyzer/munin/files/patches/0002-build-create-an-install-minimal-target-that-only-ins.patch new file mode 100644 index 000000000000..fee72bc23ad3 --- /dev/null +++ b/net-analyzer/munin/files/patches/0002-build-create-an-install-minimal-target-that-only-ins.patch @@ -0,0 +1,36 @@ +From 75ae794b1c497a82c4ce8f63c9d016cd11d3c7ba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@flameeyes.eu> +Date: Sun, 21 Oct 2012 13:39:21 -0700 +Subject: [PATCH 2/7] build: create an install-minimal target that only + installs the Node components +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is what Gentoo does right now manually, it's easier to maintain +here though, and users might want to do the same if they are +installing from sources, and only want a node. + +Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu> +--- + Makefile | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index cdc3577..c119d38 100644 +--- a/Makefile ++++ b/Makefile +@@ -64,7 +64,9 @@ tags: + + ###################################################################### + +-install: install-master-prime install-common-prime install-node-prime install-plugins-prime $(JAVA_INSTALL) install-man install-async-prime ++install: install-master-prime install-minimal install-man ++ ++install-minimal: install-common-prime install-node-prime install-plugins-prime $(JAVA_INSTALL) install-async-prime + + install-pre: Makefile Makefile.config + @$(CHECKUSER) +-- +2.2.1 + diff --git a/net-analyzer/munin/files/patches/0003-master-make-it-possible-to-configure-the-default-cgi.patch b/net-analyzer/munin/files/patches/0003-master-make-it-possible-to-configure-the-default-cgi.patch new file mode 100644 index 000000000000..63897f552c9a --- /dev/null +++ b/net-analyzer/munin/files/patches/0003-master-make-it-possible-to-configure-the-default-cgi.patch @@ -0,0 +1,113 @@ +From b634d1396bc2fba170b414f09ea07d0de702fdb8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@flameeyes.eu> +Date: Sun, 4 Nov 2012 11:18:11 -0800 +Subject: [PATCH 3/7] master: make it possible to configure the default cgi-tmp + directory. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows distributions to use, for instance, /var/cache/munin-cgi, +so that /var/lib preserves its designed purpose. + +Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu> +--- + Makefile | 7 ++++--- + Makefile.config | 3 +++ + common/lib/Munin/Common/Defaults.pm | 2 +- + master/_bin/munin-cgi-graph.in | 2 +- + master/lib/Munin/Master/Config.pm | 2 +- + master/munin.conf.in | 2 +- + 6 files changed, 11 insertions(+), 7 deletions(-) + +diff --git a/Makefile b/Makefile +index c119d38..2e30052 100644 +--- a/Makefile ++++ b/Makefile +@@ -87,14 +87,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/ ; \ +diff --git a/Makefile.config b/Makefile.config +index f5557ea..4378b60 100644 +--- a/Makefile.config ++++ b/Makefile.config +@@ -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 + +diff --git a/common/lib/Munin/Common/Defaults.pm b/common/lib/Munin/Common/Defaults.pm +index 131f52c..787b596 100644 +--- a/common/lib/Munin/Common/Defaults.pm ++++ b/common/lib/Munin/Common/Defaults.pm +@@ -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 = ''; +diff --git a/master/_bin/munin-cgi-graph.in b/master/_bin/munin-cgi-graph.in +index 651cf8c..f5a7ccd 100755 +--- a/master/_bin/munin-cgi-graph.in ++++ b/master/_bin/munin-cgi-graph.in +@@ -337,7 +337,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" : ""; +diff --git a/master/lib/Munin/Master/Config.pm b/master/lib/Munin/Master/Config.pm +index 291ffaf..b5c0813 100644 +--- a/master/lib/Munin/Master/Config.pm 2017-03-03 01:02:39.000000000 +0100 ++++ b/master/lib/Munin/Master/Config.pm 2017-07-18 19:29:44.861742592 +0200 +@@ -161,7 +161,7 @@ + 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", + ssh_command => "ssh", + ssh_options => "-o ChallengeResponseAuthentication=no -o StrictHostKeyChecking=no", + }, $class ), +diff --git a/master/munin.conf.in b/master/munin.conf.in +index 8d1a75f..046f369 100644 +--- a/master/munin.conf.in ++++ b/master/munin.conf.in +@@ -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 +-- +2.2.1 + diff --git a/net-analyzer/munin/files/patches/0005-node-use-Net-Domain-hostfqdn-instead-of-Sys-Hostname.patch b/net-analyzer/munin/files/patches/0005-node-use-Net-Domain-hostfqdn-instead-of-Sys-Hostname.patch new file mode 100644 index 000000000000..214cc4c4e6b8 --- /dev/null +++ b/net-analyzer/munin/files/patches/0005-node-use-Net-Domain-hostfqdn-instead-of-Sys-Hostname.patch @@ -0,0 +1,44 @@ +From e504b83d0db596a39f32227d4c473575e227037a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@flameeyes.eu> +Date: Sun, 11 Nov 2012 14:38:16 -0800 +Subject: [PATCH 5/7] node: use Net::Domain::hostfqdn instead of + Sys::Hostname::hostname to get the hostname. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This actually makes the test work correctly, but might change the +returned values for some hosts. + +Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu> +--- + node/lib/Munin/Node/OS.pm | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/node/lib/Munin/Node/OS.pm b/node/lib/Munin/Node/OS.pm +index 31bebac..b8fa58a 100644 +--- a/node/lib/Munin/Node/OS.pm ++++ b/node/lib/Munin/Node/OS.pm +@@ -12,7 +12,7 @@ use Munin::Node::Config; + use Munin::Common::Timeout; + + use POSIX (); +-use Sys::Hostname; ++use Net::Domain qw(hostfqdn); + + sub get_uid { + my ($class, $user) = @_; +@@ -38,9 +38,7 @@ sub _get_xid { + } + + sub get_fq_hostname { +- my $short = Sys::Hostname::hostname(); +- +- return (gethostbyname $short)[0] || $short || "unknown"; ++ return hostfqdn || "unknown"; + } + + sub check_perms_if_paranoid +-- +2.2.1 + diff --git a/net-analyzer/munin/files/patches/0007-node-always-use-the-Effective-UID-not-just-the-UID.patch b/net-analyzer/munin/files/patches/0007-node-always-use-the-Effective-UID-not-just-the-UID.patch new file mode 100644 index 000000000000..07b86e4a9f60 --- /dev/null +++ b/net-analyzer/munin/files/patches/0007-node-always-use-the-Effective-UID-not-just-the-UID.patch @@ -0,0 +1,139 @@ +From 50ca7989a481e31d2434f755812070ac8f4e14c5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@flameeyes.eu> +Date: Sun, 11 Nov 2012 15:18:51 -0800 +Subject: [PATCH 7/7] node: always use the Effective UID not just the UID. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu> +--- + common/lib/Munin/Common/Defaults.pm | 6 +++--- + node/t/munin_node_config.t | 12 ++++++------ + node/t/munin_node_os.t | 6 +++--- + node/t/munin_node_service.t | 14 +++++++------- + 4 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/common/lib/Munin/Common/Defaults.pm b/common/lib/Munin/Common/Defaults.pm +index 787b596..0f7f292 100644 +--- a/common/lib/Munin/Common/Defaults.pm ++++ b/common/lib/Munin/Common/Defaults.pm +@@ -32,9 +32,9 @@ our $MUNIN_SPOOLDIR = ''; + our $MUNIN_MANDIR = ''; + our $MUNIN_LOGDIR = "$COMPONENT_ROOT/log/"; + our $MUNIN_STATEDIR = ''; +-our $MUNIN_USER = getpwuid $UID; +-our $MUNIN_GROUP = getgrgid $GID; +-our $MUNIN_PLUGINUSER = getpwuid $UID; ++our $MUNIN_USER = getpwuid $EUID; ++our $MUNIN_GROUP = getgrgid $EGID; ++our $MUNIN_PLUGINUSER = getpwuid $EUID; + our $MUNIN_VERSION = 'svn'; + our $MUNIN_PERL = '/usr/bin/perl'; + our $MUNIN_PERLLIB = ''; +diff --git a/node/t/munin_node_config.t b/node/t/munin_node_config.t +index b8b6564..3d5530f 100644 +--- a/node/t/munin_node_config.t ++++ b/node/t/munin_node_config.t +@@ -43,13 +43,13 @@ isa_ok($conf, 'Munin::Node::Config'); + + ### Default user + { +- my $uname = getpwuid $UID; ++ my $uname = getpwuid $EUID; + + my @res = $conf->_parse_line("default_client_user $uname"); +- is_deeply(\@res, [defuser => $UID], 'Parsing default user name'); ++ is_deeply(\@res, [defuser => $EUID], 'Parsing default user name'); + + @res = $conf->_parse_line("default_client_user $UID"); +- is_deeply(\@res, [defuser => $UID], 'Parsing default user ID'); ++ is_deeply(\@res, [defuser => $EUID], 'Parsing default user ID'); + + eval { $conf->_parse_line("default_client_user xxxyyyzzz") }; + like($@, qr{Default user does not exist}, "Default user exists"); +@@ -184,13 +184,13 @@ isa_ok($conf, 'Munin::Node::Config'); + + ### user + { +- my $uname = getpwuid $UID; ++ my $uname = getpwuid $EUID; + + my @res = $conf->_parse_plugin_line("user $uname"); + is_deeply(\@res, [user => $uname], 'Parsing plugin user name'); + +- @res = $conf->_parse_plugin_line("user $UID"); +- is_deeply(\@res, [user => $UID], 'Parsing plugin user ID'); ++ @res = $conf->_parse_plugin_line("user $EUID"); ++ is_deeply(\@res, [user => $EUID], 'Parsing plugin user ID'); + } + + ### group +diff --git a/node/t/munin_node_os.t b/node/t/munin_node_os.t +index 96d7c74..e10d9e6 100644 +--- a/node/t/munin_node_os.t ++++ b/node/t/munin_node_os.t +@@ -13,10 +13,10 @@ my $os = 'Munin::Node::OS'; + + ### get_uid + { +- my $uname = getpwuid $UID; ++ my $uname = getpwuid $EUID; + +- is($os->get_uid($uname), $UID, 'Lookup by user name'); +- is($os->get_uid($UID), $UID, 'Lookup by user ID'); ++ is($os->get_uid($uname), $EUID, 'Lookup by user name'); ++ is($os->get_uid($EUID), $EUID, 'Lookup by user ID'); + + is($os->get_uid('%%SSKK¤¤'), undef, 'Nonexistent user name'); + is($os->get_uid(999999999), undef, 'Nonexistent user ID'); +diff --git a/node/t/munin_node_service.t b/node/t/munin_node_service.t +index 18bda89..7fa050e 100644 +--- a/node/t/munin_node_service.t ++++ b/node/t/munin_node_service.t +@@ -12,8 +12,8 @@ use Munin::Node::Service; + + use English qw(-no_match_vars); + +-my $uname = getpwuid $UID; +-my $gid = (split / /, $GID)[0]; ++my $uname = getpwuid $EUID; ++my $gid = (split / /, $EGID)[0]; + my $gname = getgrgid $gid; + + +@@ -39,7 +39,7 @@ $config->reinitialize({ + + # testing user resolution + uname => { user => $uname }, +- uid => { user => $UID }, ++ uid => { user => $EUID }, + bad_uname => { user => '%%SSKK¤¤' }, + bad_uid => { user => 999999999 }, + +@@ -155,7 +155,7 @@ $ENV{MUNIN_MASTER_IP} = ''; + + ### export_service_environment + { +- my $services = Munin::Node::Service->new(defuser => $UID); ++ my $services = Munin::Node::Service->new(defuser => $EUID); + + $services->export_service_environment('test'); + is($ENV{test_environment_variable}, 'fnord', 'Service-specific environment is exported'); +@@ -164,10 +164,10 @@ $ENV{MUNIN_MASTER_IP} = ''; + + ### _resolve_uid + { +- my $services = Munin::Node::Service->new(defuser => $UID); ++ my $services = Munin::Node::Service->new(defuser => $EUID); + +- is($services->_resolve_uid('uname'), $UID, 'Lookup by service-specific username'); +- is($services->_resolve_uid('uid'), $UID, 'Lookup by service-specific username'); ++ is($services->_resolve_uid('uname'), $EUID, 'Lookup by service-specific username'); ++ is($services->_resolve_uid('uid'), $EUID, 'Lookup by service-specific username'); + + $services->{defuser} = 0; + +-- +2.2.1 + diff --git a/net-analyzer/munin/files/patches/0009-perl-526.patch b/net-analyzer/munin/files/patches/0009-perl-526.patch new file mode 100644 index 000000000000..d3cabb9906c3 --- /dev/null +++ b/net-analyzer/munin/files/patches/0009-perl-526.patch @@ -0,0 +1,26 @@ + + +diff -ruN munin-2.0.33.orig/master/Build.PL munin-2.0.33/master/Build.PL +--- munin-2.0.33.orig/master/Build.PL 2017-03-03 00:02:39.000000000 -0000 ++++ munin-2.0.33/master/Build.PL 2017-08-05 15:06:55.799816839 -0000 +@@ -1,3 +1,4 @@ ++use lib q[.]; + use MasterBuilder; + + use warnings; +diff -ruN munin-2.0.33.orig/node/Build.PL munin-2.0.33/node/Build.PL +--- munin-2.0.33.orig/node/Build.PL 2017-03-03 00:02:39.000000000 -0000 ++++ munin-2.0.33/node/Build.PL 2017-08-05 15:11:07.689824612 -0000 +@@ -1,3 +1,4 @@ ++use lib q[.]; + use NodeBuilder; + + use warnings; +diff -ruN munin-2.0.33.orig/plugins/Build.PL munin-2.0.33/plugins/Build.PL +--- munin-2.0.33.orig/plugins/Build.PL 2017-03-03 00:02:39.000000000 -0000 ++++ munin-2.0.33/plugins/Build.PL 2017-08-05 15:13:57.056168401 -0000 +@@ -1,3 +1,4 @@ ++use lib q[.]; + use PluginsBuilder; + + use warnings; |