View | Details | Raw Unified | Return to bug 77721
Collapse All | Expand All

(-)munin-node-1.2.0/Makefile (-21 / +15 lines)
Lines 2-17 Link Here
2
# Date created:				25 Januar 2004
2
# Date created:				25 Januar 2004
3
# Whom:					Lupe Christoph <lupe@lupe-christoph.de>
3
# Whom:					Lupe Christoph <lupe@lupe-christoph.de>
4
#
4
#
5
# $FreeBSD: ports/sysutils/munin-node/Makefile,v 1.10 2004/11/16 15:16:37 leeym Exp $
5
# $FreeBSD: ports/sysutils/munin-node/Makefile,v 1.12 2004/12/14 01:43:10 sem Exp $
6
#
6
#
7
7
8
PORTNAME=	munin
8
PORTNAME=	munin
9
PORTVERSION=	1.0.4
9
PORTVERSION=	1.2.0
10
CATEGORIES=	sysutils perl5
10
CATEGORIES=	sysutils perl5
11
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
11
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITE_SUBDIR=	munin
12
MASTER_SITE_SUBDIR=	munin
13
PKGNAMESUFFIX=	-node
13
PKGNAMESUFFIX=	-node
14
DISTNAME=	${PORTNAME}_${PORTVERSION:S/.p/pre/}
14
DISTNAME=	${PORTNAME}_${PORTVERSION:S/.r/rc/}
15
15
16
MAINTAINER=	lupe@lupe-christoph.de
16
MAINTAINER=	lupe@lupe-christoph.de
17
COMMENT=	Node-specific part of Munin
17
COMMENT=	Node-specific part of Munin
Lines 27-63 Link Here
27
27
28
USE_GMAKE=	yes
28
USE_GMAKE=	yes
29
PATCH_STRIP=	-p1
29
PATCH_STRIP=	-p1
30
WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION:S/.p/pre/}
30
WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION:S/.r/rc/}
31
PKGMESSAGE=	${WRKDIR}/pkg-message
31
PKGMESSAGE=	${WRKDIR}/pkg-message
32
ALL_TARGET=	DATADIR=${DATADIR} build build-man
32
ALL_TARGET=	DATADIR=${DATADIR} PERL=${PERL} build build-man
33
INSTALL_TARGET=	DATADIR=${DATADIR} install-node install-node-plugins
33
INSTALL_TARGET=	DATADIR=${DATADIR} PERL=${PERL} install-node install-node-plugins
34
MAKE_ENV=	LANG=C
34
MAKE_ENV=	LANG=C
35
NOPRECIOUSMAKEVARS=yes
36
35
37
MAN5=		munin-node.conf.5
36
MAN5=		munin-node.conf.5
38
MAN8=		munin-node-configure.8 munin-node.8 munin-run.8
37
MAN8=		munin-node-configure.8 munin-node.8 munin-run.8
39
38
40
.if ${OSVERSION} < 500000
39
SUB_FILES=	pkg-message munin-node.sh munin-node-revive.sh
41
PKGMSG=${FILESDIR}/pkg-message.4
40
SUB_LIST=	RC_SUBR=${RC_SUBR}
42
STARTSTOP_SRC=${FILESDIR}/munin-node.sh
41
USE_RC_SUBR=	YES
43
STARTSTOP_DST=${PREFIX}/etc/rc.d/munin-node.sh
44
.else
45
PKGMSG=${FILESDIR}/pkg-message
46
STARTSTOP_SRC=${FILESDIR}/munin_node.sh
47
STARTSTOP_DST=/etc/rc.d/munin_node
48
.endif
49
42
50
pre-install:
43
pre-install:
51
	@${SED} 's@%%PREFIX%%@${PREFIX}@g' ${PKGMSG} > ${PKGMESSAGE}
52
	@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
44
	@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
53
45
54
post-install:
46
post-install:
55
	@${SED} 's@%PREFIX%@${LOCALBASE}@g' ${STARTSTOP_SRC} > ${STARTSTOP_DST}
47
	${INSTALL_SCRIPT} ${WRKDIR}/munin-node.sh ${PREFIX}/etc/rc.d/munin-node.sh
56
	@${CHMOD} +x ${STARTSTOP_DST}
48
.if ${PERL_LEVEL} < 500800
49
	${INSTALL_SCRIPT} ${WRKDIR}/munin-node-revive.sh ${PREFIX}/bin/munin-node-revive
50
.endif
57
	${INSTALL_DATA} ${WRKSRC}/build/node/munin-node.conf ${PREFIX}/etc/munin/munin-node.conf.sample
51
	${INSTALL_DATA} ${WRKSRC}/build/node/munin-node.conf ${PREFIX}/etc/munin/munin-node.conf.sample
58
	${INSTALL_DATA} ${WRKSRC}/plugins.conf ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf.sample
52
	${INSTALL_DATA} files/plugins.conf ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf.sample
59
	@if [ ! -f ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf ]; then \
53
	@if [ ! -f ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf ]; then \
60
		${INSTALL_DATA} ${WRKSRC}/plugins.conf ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf; \
54
		${INSTALL_DATA} ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf.sample ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf; \
61
	fi
55
	fi
62
	@${CAT} ${PKGMESSAGE}
56
	@${CAT} ${PKGMESSAGE}
63
	@${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-node.conf.5 ${PREFIX}/man/man5
57
	@${INSTALL_MAN} -C ${WRKSRC}/build/doc/munin-node.conf.5 ${PREFIX}/man/man5
(-)munin-node-1.2.0/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
MD5 (munin_1.0.4.tar.gz) = 00721181e1ff81be85ad89307457d998
1
MD5 (munin_1.2.0.tar.gz) = bbab7bf91ac837e4c72889aaef7cf2e8
2
SIZE (munin_1.0.4.tar.gz) = 214902
2
SIZE (munin_1.2.0.tar.gz) = 318364
(-)munin-node-1.2.0/pkg-deinstall (-16 / +37 lines)
Lines 1-13 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
#
3
# $Log: pkg-deinstall,v $
4
# Revision 1.2.2.1  2004/11/21 10:52:27  lupe
5
# make stop_process use old or new start-stop script.
6
#
7
# Revision 1.2  2004/02/06 18:49:58  lupe
8
# Fixes for pkg_add compatibility.
9
#
10
#
11
2
12
ask() {
3
ask() {
13
    local question default answer
4
    local question default answer
Lines 39-44 Link Here
39
}
30
}
40
31
41
stop_process() {
32
stop_process() {
33
    STARTSTOP=${PKG_PREFIX}/etc/rc.d/munin-node.sh
34
42
    if [ -x $STARTSTOP ]; then
35
    if [ -x $STARTSTOP ]; then
43
	$STARTSTOP stop
36
	$STARTSTOP stop
44
    fi
37
    fi
Lines 54-70 Link Here
54
    fi
47
    fi
55
}
48
}
56
49
57
OSVERSION=`/sbin/sysctl -n kern.osreldate`
50
delete_crontab_entries() {
58
if [ $OSVERSION -lt 500000 ]; then
51
    local prog
59
    STARTSTOP=${PKG_PREFIX}/etc/rc.d/munin-node.sh
52
    prog=$1
60
else
53
61
    STARTSTOP=/etc/rc.d/munin_node
54
    if grep -q "^[^#]*$prog" /etc/crontab; then
62
fi
55
	TMPFILE=`mktemp -t munin` || exit 1
56
	grep -v $prog /etc/crontab > $TMPFILE
57
	cat $TMPFILE > /etc/crontab
58
	rm $/etc/crontab
59
    fi
60
}
61
62
delnewsyslog() {
63
    tmp="/etc/#munin-node$$"
64
    sed -e '/^\/var\/log\/munin-node.log[ 	]/d' /etc/newsyslog.conf >${tmp}
65
    cat ${tmp} > /etc/newsyslog.conf
66
    rm ${tmp}
67
}
68
69
newsyslog() {
70
    ENTRY=`grep /var/log/munin-node.log /etc/newsyslog.conf`
71
    DEFAULT='/var/log/munin-node.log			644  7	   *	@T00  Z	/var/run/munin/munin-node.pid'
72
    if [ -z "$ENTRY" ]; then
73
	exit 0
74
    elif [ "$ENTRY" = "$DEFAULT" ]; then
75
	delnewsyslog
76
    elif yesno "You have changed the default munin-node entry in \"/etc/newsyslog.conf\".
77
Do you want me to delete it?" y; then
78
	delnewsyslog
79
	echo "Done."
80
    fi
81
}
82
63
83
64
case $2 in
84
case $2 in
65
    DEINSTALL)
85
    DEINSTALL)
86
	delete_crontab_entries ${PKG_PREFIX}/bin/munin-node-revive
66
	stop_process
87
	stop_process
67
	exit 0 # ignore error
88
	newsyslog
68
	;;
89
	;;
69
    POST-DEINSTALL)
90
    POST-DEINSTALL)
70
	delete_group munin
91
	delete_group munin
(-)munin-node-1.2.0/pkg-install (-8 / +39 lines)
Lines 1-10 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
#
3
# $Log: pkg-install,v $
4
# Revision 1.2  2004/02/06 18:49:58  lupe
5
# Fixes for pkg_add compatibility.
6
#
7
#
8
2
9
ask() {
3
ask() {
10
    local question default answer
4
    local question default answer
Lines 63-70 Link Here
63
	prevver=$(cat ${PKG_PREFIX}/etc/munin/VERSION.node)
57
	prevver=$(cat ${PKG_PREFIX}/etc/munin/VERSION.node)
64
    fi
58
    fi
65
59
66
    mkdir -p ${PKG_PREFIX}/etc/munin/plugins ${PKG_PREFIX}/var/munin/plugin-state
67
68
    if [ -n "$prevver" ]; then
60
    if [ -n "$prevver" ]; then
69
	echo -n "Initializing new plugins.."
61
	echo -n "Initializing new plugins.."
70
	${PKG_PREFIX}/sbin/munin-node-configure --shell --newer "${prevver%-*}" | sh -x
62
	${PKG_PREFIX}/sbin/munin-node-configure --shell --newer "${prevver%-*}" | sh -x
Lines 75-80 Link Here
75
    echo "done."
67
    echo "done."
76
}
68
}
77
69
70
create_crontab_entries() {
71
    local sched prog
72
    sched=$1
73
    prog=$2
74
75
    if grep -q "^[^#]*$prog" /etc/crontab; then
76
	echo "It looks like your crontab is already set up, so I'll use that."
77
    else
78
	echo "It looks like your perl suffers from unsafe signals."
79
	if yesno "Would you like me to set up your root crontab to restart munin-node" y; then
80
	    cat <<EOT >>/etc/crontab
81
$sched	root	$prog
82
EOT
83
	else
84
	    echo "You may suffer from munin-node crashing after log rotation."
85
	    echo "If you still want to restart munin-node, use $prog."
86
	fi
87
    fi
88
}
89
90
newsyslog() {
91
    if yesno "Would you like me to set up log rotation" y; then
92
	if grep -q /var/log/munin-node.log /etc/newsyslog.conf; then
93
	    :
94
	else
95
	    cat >> /etc/newsyslog.conf <<EOT
96
/var/log/munin-node.log			644  7	   *	@T00  Z	/var/run/munin/munin-node.pid
97
EOT
98
	fi
99
	if [ -f ${PKG_PREFIX}/bin/munin-node-revive ]; then
100
	    create_crontab_entries '4	*	*	*	*' ${PKG_PREFIX}/bin/munin-node-revive
101
	fi
102
    else
103
	echo "/var/log/munin-node.log will grow without bounds."
104
    fi
105
}
106
78
107
79
########################################################################
108
########################################################################
80
109
Lines 84-88 Link Here
84
	;;      
113
	;;      
85
    POST-INSTALL)
114
    POST-INSTALL)
86
	init_plugins
115
	init_plugins
116
	${PKG_PREFIX}/etc/rc.d/munin-node.sh start
117
	newsyslog
87
	;;      
118
	;;      
88
esac
119
esac
(-)munin-node-1.2.0/pkg-plist (-3 / +40 lines)
Lines 1-12 Link Here
1
@exec mkdir -p %D/etc/munin/plugins
2
@exec mkdir -p %D/etc/munin/plugin-conf.d && chmod 755 %D/etc/munin/plugin-conf.d
3
@exec mkdir -p %D/var/munin/plugin-state && chgrp munin %D/var/munin/plugin-state && chmod 775 %D/var/munin/plugin-state
4
@unexec rm %D/bin/munin-node-revive 2>/dev/null || true
1
@comment etc/munin/VERSION.node must remain for upgrade version check
5
@comment etc/munin/VERSION.node must remain for upgrade version check
2
@unexec if cmp -s %D/etc/munin/munin-node.conf %D/etc/munin/munin-node.conf.sample; then rm -f %D/etc/munin/munin-node.conf; fi
6
@unexec if cmp -s %D/etc/munin/munin-node.conf %D/etc/munin/munin-node.conf.sample; then rm -f %D/etc/munin/munin-node.conf; fi
3
etc/munin/munin-node.conf.sample
7
etc/munin/munin-node.conf.sample
4
@unexec if cmp -s %D/etc/munin/plugin-conf.d/plugins.conf %D/etc/munin/plugin-conf.d/plugins.conf.sample; then rm -f %D/etc/munin/plugin-conf.d/plugins.conf; fi
8
@unexec if cmp -s %D/etc/munin/plugin-conf.d/plugins.conf %D/etc/munin/plugin-conf.d/plugins.conf.sample; then rm -f %D/etc/munin/plugin-conf.d/plugins.conf; fi
5
etc/munin/plugin-conf.d/plugins.conf.sample
9
etc/munin/plugin-conf.d/plugins.conf.sample
6
@unexec rm %D/etc/rc.d/munin-node.sh 2>/dev/null || true
10
@unexec rm %D/etc/rc.d/munin-node.sh 2>/dev/null || true
7
@unexec rm /etc/rc.d/munin_node 2>/dev/null || true
8
sbin/munin-node
11
sbin/munin-node
9
sbin/munin-node-configure
12
sbin/munin-node-configure
13
sbin/munin-node-configure-snmp
10
sbin/munin-run
14
sbin/munin-run
11
%%DATADIR%%/plugins/acpi
15
%%DATADIR%%/plugins/acpi
12
%%DATADIR%%/plugins/amavis
16
%%DATADIR%%/plugins/amavis
Lines 14-35 Link Here
14
%%DATADIR%%/plugins/apache_processes
18
%%DATADIR%%/plugins/apache_processes
15
%%DATADIR%%/plugins/apache_volume
19
%%DATADIR%%/plugins/apache_volume
16
%%DATADIR%%/plugins/apc_envunit_
20
%%DATADIR%%/plugins/apc_envunit_
21
%%DATADIR%%/plugins/apc_nis
17
%%DATADIR%%/plugins/bind9
22
%%DATADIR%%/plugins/bind9
23
%%DATADIR%%/plugins/bind9_rndc
24
%%DATADIR%%/plugins/courier_
25
%%DATADIR%%/plugins/courier_mta_mailqueue
26
%%DATADIR%%/plugins/courier_mta_mailstats
27
%%DATADIR%%/plugins/courier_mta_mailvolume
18
%%DATADIR%%/plugins/cpu
28
%%DATADIR%%/plugins/cpu
29
%%DATADIR%%/plugins/cupsys_pages
19
%%DATADIR%%/plugins/df
30
%%DATADIR%%/plugins/df
20
%%DATADIR%%/plugins/df_inode
31
%%DATADIR%%/plugins/df_inode
32
%%DATADIR%%/plugins/dhcpd3
21
%%DATADIR%%/plugins/exim_mailqueue
33
%%DATADIR%%/plugins/exim_mailqueue
34
%%DATADIR%%/plugins/exim_mailqueue_alt
22
%%DATADIR%%/plugins/exim_mailstats
35
%%DATADIR%%/plugins/exim_mailstats
23
%%DATADIR%%/plugins/folding@home
36
%%DATADIR%%/plugins/foldingathome
37
%%DATADIR%%/plugins/foldingathome_rank
38
%%DATADIR%%/plugins/foldingathome_wu
24
%%DATADIR%%/plugins/hddtemp
39
%%DATADIR%%/plugins/hddtemp
25
%%DATADIR%%/plugins/hddtemp2
40
%%DATADIR%%/plugins/hddtemp2
41
%%DATADIR%%/plugins/hddtemp_smartctl
42
%%DATADIR%%/plugins/hddtempd
26
%%DATADIR%%/plugins/if_
43
%%DATADIR%%/plugins/if_
27
%%DATADIR%%/plugins/if_errcoll_
44
%%DATADIR%%/plugins/if_errcoll_
28
%%DATADIR%%/plugins/ipac-ng
45
%%DATADIR%%/plugins/ipac-ng
29
%%DATADIR%%/plugins/ircu
46
%%DATADIR%%/plugins/ircu
30
%%DATADIR%%/plugins/load
47
%%DATADIR%%/plugins/load
48
%%DATADIR%%/plugins/loggrep
31
%%DATADIR%%/plugins/mailman
49
%%DATADIR%%/plugins/mailman
50
%%DATADIR%%/plugins/mailscanner
32
%%DATADIR%%/plugins/memory
51
%%DATADIR%%/plugins/memory
52
%%DATADIR%%/plugins/mhttping
33
%%DATADIR%%/plugins/multips
53
%%DATADIR%%/plugins/multips
34
%%DATADIR%%/plugins/munin_graph
54
%%DATADIR%%/plugins/munin_graph
35
%%DATADIR%%/plugins/munin_update
55
%%DATADIR%%/plugins/munin_update
Lines 40-48 Link Here
40
%%DATADIR%%/plugins/mysql_threads
60
%%DATADIR%%/plugins/mysql_threads
41
%%DATADIR%%/plugins/named
61
%%DATADIR%%/plugins/named
42
%%DATADIR%%/plugins/netstat
62
%%DATADIR%%/plugins/netstat
63
%%DATADIR%%/plugins/ntp_
64
%%DATADIR%%/plugins/ntp_states
65
%%DATADIR%%/plugins/nut_misc
66
%%DATADIR%%/plugins/nut_volts
43
%%DATADIR%%/plugins/open_files
67
%%DATADIR%%/plugins/open_files
68
%%DATADIR%%/plugins/perdition
69
%%DATADIR%%/plugins/ping_
44
%%DATADIR%%/plugins/plugins.history
70
%%DATADIR%%/plugins/plugins.history
45
%%DATADIR%%/plugins/pm3users
71
%%DATADIR%%/plugins/pm3users_
46
%%DATADIR%%/plugins/pop_stats
72
%%DATADIR%%/plugins/pop_stats
47
%%DATADIR%%/plugins/postfix_mailqueue
73
%%DATADIR%%/plugins/postfix_mailqueue
48
%%DATADIR%%/plugins/postfix_mailstats
74
%%DATADIR%%/plugins/postfix_mailstats
Lines 54-59 Link Here
54
%%DATADIR%%/plugins/sendmail_mailqueue
80
%%DATADIR%%/plugins/sendmail_mailqueue
55
%%DATADIR%%/plugins/sendmail_mailstats
81
%%DATADIR%%/plugins/sendmail_mailstats
56
%%DATADIR%%/plugins/sendmail_mailtraffic
82
%%DATADIR%%/plugins/sendmail_mailtraffic
83
%%DATADIR%%/plugins/smart_
57
%%DATADIR%%/plugins/snmp__df
84
%%DATADIR%%/plugins/snmp__df
58
%%DATADIR%%/plugins/snmp__fc_if_
85
%%DATADIR%%/plugins/snmp__fc_if_
59
%%DATADIR%%/plugins/snmp__fc_if_err_
86
%%DATADIR%%/plugins/snmp__fc_if_err_
Lines 61-66 Link Here
61
%%DATADIR%%/plugins/snmp__if_err_
88
%%DATADIR%%/plugins/snmp__if_err_
62
%%DATADIR%%/plugins/snmp__load
89
%%DATADIR%%/plugins/snmp__load
63
%%DATADIR%%/plugins/snmp__processes
90
%%DATADIR%%/plugins/snmp__processes
91
%%DATADIR%%/plugins/snmp__sensors_fsc_bx_fan
92
%%DATADIR%%/plugins/snmp__sensors_fsc_bx_temp
93
%%DATADIR%%/plugins/snmp__sensors_fsc_fan
94
%%DATADIR%%/plugins/snmp__sensors_fsc_temp
95
%%DATADIR%%/plugins/snmp__sensors_mbm_fan
96
%%DATADIR%%/plugins/snmp__sensors_mbm_temp
97
%%DATADIR%%/plugins/snmp__sensors_mbm_volt
64
%%DATADIR%%/plugins/snmp__users
98
%%DATADIR%%/plugins/snmp__users
65
%%DATADIR%%/plugins/spamstats
99
%%DATADIR%%/plugins/spamstats
66
%%DATADIR%%/plugins/squid_cache
100
%%DATADIR%%/plugins/squid_cache
Lines 71-78 Link Here
71
%%DATADIR%%/plugins/swap
105
%%DATADIR%%/plugins/swap
72
%%DATADIR%%/plugins/sybase_space
106
%%DATADIR%%/plugins/sybase_space
73
%%DATADIR%%/plugins/vmstat
107
%%DATADIR%%/plugins/vmstat
108
@unexec rm -f /var/run/munin/munin-node.pid
109
@unexec rmdir /var/run/munin 2>/dev/null || true
74
@unexec rmdir %D/var/munin/plugin-state 2>/dev/null || true
110
@unexec rmdir %D/var/munin/plugin-state 2>/dev/null || true
75
@unexec rmdir %D/var/munin 2>/dev/null || true
111
@unexec rmdir %D/var/munin 2>/dev/null || true
112
@unexec rmdir %D/%%DATADIR%%/plugins 2>/dev/null || true
76
@unexec rmdir %D/%%DATADIR%% 2>/dev/null || true
113
@unexec rmdir %D/%%DATADIR%% 2>/dev/null || true
77
@unexec rmdir %D/etc/munin/plugin-conf.d 2>/dev/null || true
114
@unexec rmdir %D/etc/munin/plugin-conf.d 2>/dev/null || true
78
@unexec rmdir %D/etc/munin 2>/dev/null || true
115
@unexec rmdir %D/etc/munin 2>/dev/null || true

Return to bug 77721