aboutsummaryrefslogtreecommitdiff
path: root/sysutils/munin-main/pkg-install
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/munin-main/pkg-install')
-rw-r--r--sysutils/munin-main/pkg-install51
1 files changed, 20 insertions, 31 deletions
diff --git a/sysutils/munin-main/pkg-install b/sysutils/munin-main/pkg-install
index 151594997c34..1208f695a04e 100644
--- a/sysutils/munin-main/pkg-install
+++ b/sysutils/munin-main/pkg-install
@@ -1,7 +1,4 @@
#! /bin/sh
-#
-# $Log$
-#
ask() {
local question default answer
@@ -71,24 +68,15 @@ make_account() {
fi
}
-make_directories() {
- for dir in ${PKG_PREFIX}/www/data/munin \
- ${PKG_PREFIX}/var/munin \
- /var/run/munin; do
- mkdir -p $dir
- chown munin $dir
- done
-}
-
create_crontab_entries() {
local b e
b=$1
e=$2
- if [ crontab -u munin -l > /dev/null 2>&1 ]; then
+ if crontab -u munin -l > /dev/null 2>&1; then
TMPFILE=`mktemp -t munin` || exit 1
- sed -n -e "/^$b\$/,/^$e\$/p" > $TMPFILE
- crontab -u munin -l | sed -e '/^#BEGIN_MUNIN$/,/^#END_MUNIN$/d' | \
+ cat > $TMPFILE
+ crontab -u munin -l | sed -e "/^$b$/,/^$e$/d" | \
cat - $TMPFILE | crontab -u munin -
rm $TMPFILE
else
@@ -96,33 +84,34 @@ create_crontab_entries() {
fi
}
+mklogdir() {
+}
+
+newsyslog() {
+ if fgrep -q '/var/log/munin-main/*' /etc/newsyslog.conf; then
+ :
+ else
+ cat >> /etc/newsyslog.conf <<EOT
+/var/log/munin-main/*.log munin:munin 644 7 * @T00 GNWZ
+EOT
+ fi
+}
+
########################################################################
case $2 in
PRE-INSTALL)
- # Munin had a logo.gif up to 1.0.0pre3.
- # Remove it, it's been replaced by logo.png
- rm -f ${PKG_PREFIX}/www/data/munin/logo.gif
- # The old stylesheet must go, too.
- rm -f ${PKG_PREFIX}/www/data/munin/style.css
- # Both new files will be put in place by munin-html
-
make_account munin munin "Munin owner"
- make_directories
;;
POST-INSTALL)
- create_crontab_entries '#BEGIN_MUNIN' '#END_MUNIN' <<EOT
-#
-# cron-jobs for munin
-#
-
-#BEGIN_MUNIN
+ newsyslog
+ create_crontab_entries '#BEGIN_MUNIN_MAIN' '#END_MUNIN_MAIN' <<EOT
+#BEGIN_MUNIN_MAIN
MAILTO=root
*/5 * * * * ${PKG_PREFIX}/bin/munin-cron
-10 10 * * * ${DATADIR:=${PKG_PREFIX}/share/munin}/munin-nagios --removeok
-#END_MUNIN
+#END_MUNIN_MAIN
EOT
;;
esac