From d3ee31fd116f4794dfbb53a517f1417a8d096819 Mon Sep 17 00:00:00 2001 From: Techlive Zheng Date: Thu, 27 Dec 2012 22:49:15 +0800 Subject: [PATCH 2/5] Output generated html files to /var/lib/munin/www These generated html files are actually runtime files, it is not appropriate to put them under /usr, /var/lib is a good place. * Backup .htaccess file * Add an example Apache configuration file --- modif/munin/Makefile.config | 2 +- modif/munin/PKGBUILD | 6 +++++- modif/munin/apache.example.conf | 7 +++++++ modif/munin/munin.install | 6 ++++++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 modif/munin/apache.example.conf diff --git a/modif/munin/Makefile.config b/modif/munin/Makefile.config index ca3ff27..ca89ac2 100644 --- a/modif/munin/Makefile.config +++ b/modif/munin/Makefile.config @@ -35,7 +35,7 @@ MANDIR = $(PREFIX)/usr/share/man LIBDIR = $(PREFIX)/usr/lib/munin # Server only - Output directory -HTMLDIR = $(PREFIX)/usr/share/munin/www +HTMLDIR = $(PREFIX)/var/lib/munin/www CGIDIR = $(PREFIX)/usr/share/munin/cgi # Where to put RRD files and other internal data, both master and node diff --git a/modif/munin/PKGBUILD b/modif/munin/PKGBUILD index e95ea38..f038be6 100644 --- a/modif/munin/PKGBUILD +++ b/modif/munin/PKGBUILD @@ -24,6 +24,7 @@ source=(http://downloads.sourceforge.net/sourceforge/munin/munin-$pkgver.tar.gz munin-node.service munin-graph.{service,socket} munin-html.{service,socket} + apache.example.conf 08-munin-font-dir.conf) build() { @@ -40,19 +41,22 @@ package_munin() { depends=('perl' 'rrdtool' 'perl-html-template' 'perl-date-manip' 'perl-log-log4perl' 'perl-io-socket-inet6' 'perl-file-copy-recursive' 'perl-fcgi' 'perl-uri' 'munin-node') - backup=(etc/munin/munin.conf etc/logrotate.d/munin) + backup=(etc/munin/munin.conf etc/logrotate.d/munin etc/webapps/munin/.htaccess) install=munin.install cd "$srcdir/munin-$pkgver" make DESTDIR="$pkgdir" install-master-prime install -D -m644 ../munin-cron-entry "$pkgdir"/etc/munin/munin-cron-entry install -D -m644 ../logrotate.munin "$pkgdir"/etc/logrotate.d/munin + install -D -m644 ../apache.example.conf "$pkgdir"/etc/webapps/munin/apache.example.conf install -D -m644 ../munin.tmpfiles.conf "$pkgdir"/usr/lib/tmpfiles.d/munin.conf install -D -m644 ../munin-graph.service "$pkgdir"/usr/lib/systemd/system/munin-graph.service install -D -m644 ../munin-graph.socket "$pkgdir"/usr/lib/systemd/system/munin-graph.socket install -D -m644 ../munin-html.service "$pkgdir"/usr/lib/systemd/system/munin-html.service install -D -m644 ../munin-html.socket "$pkgdir"/usr/lib/systemd/system/munin-html.socket install -D -m644 ../08-munin-font-dir.conf "$pkgdir"/etc/fonts/conf.d/08-munin-font-dir.conf + mv "$pkgdir"/var/lib/munin/www/.htaccess "$pkgdir"/etc/webapps/munin/.htaccess + ln -s /etc/webapps/munin/.htaccess "$pkgdir"/var/lib/munin/www/.htaccess rm -rf "$pkgdir/run" } diff --git a/modif/munin/apache.example.conf b/modif/munin/apache.example.conf new file mode 100644 index 0000000..b7827f9 --- /dev/null +++ b/modif/munin/apache.example.conf @@ -0,0 +1,7 @@ + Alias /munin "/var/lib/munin/www" + + Options FollowSymlinks + AllowOverride All + Order allow,deny + Allow from all + diff --git a/modif/munin/munin.install b/modif/munin/munin.install index 954fb79..d7a45a9 100644 --- a/modif/munin/munin.install +++ b/modif/munin/munin.install @@ -6,6 +6,12 @@ post_install () { # Display cron command echo "==> See the example cron entry (for the munin user) for further setup:" echo " /etc/munin/munin-cron-entry" + echo "==> The default location of the generated html files has been changed" + echo " to /var/lib/munin/www, please update your /etc/munin.conf and move" + echo " the old html files from /usr/share/www/munin or whaterver other" + echo " place you use. There is an example Apache configuration file at" + echo " /etc/webapps/munin/apache.example.conf which could be included" + echo " in your /etc/httd/conf/httpd.conf." post_upgrade } -- 1.8.0.2