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

(-)ports/sysutils/munin-node/Makefile (-4 / +17 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	munin
8
PORTNAME=	munin
9
PORTVERSION=	1.0.3
9
PORTVERSION=	1.0.4
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
Lines 32-48 Link Here
32
ALL_TARGET=	DATADIR=${DATADIR} build build-man
32
ALL_TARGET=	DATADIR=${DATADIR} build build-man
33
INSTALL_TARGET=	DATADIR=${DATADIR} install-node install-node-plugins
33
INSTALL_TARGET=	DATADIR=${DATADIR} install-node install-node-plugins
34
MAKE_ENV=	LANG=C
34
MAKE_ENV=	LANG=C
35
NOPRECIOUSMAKEVARS=yes
35
36
36
MAN5=		munin-node.conf.5
37
MAN5=		munin-node.conf.5
37
MAN8=		munin-node-configure.8 munin-node.8 munin-run.8
38
MAN8=		munin-node-configure.8 munin-node.8 munin-run.8
38
39
40
.if ${OSVERSION} < 500000
41
PKGMSG=${FILESDIR}/pkg-message.4
42
STARTSTOP_SRC=${FILESDIR}/munin-node.sh
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
39
pre-install:
50
pre-install:
40
	@${SED} 's@%%PREFIX%%@${PREFIX}@g' ${FILESDIR}/pkg-message > ${PKGMESSAGE}
51
	@${SED} 's@%%PREFIX%%@${PREFIX}@g' ${PKGMSG} > ${PKGMESSAGE}
41
	@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
52
	@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
42
53
43
post-install:
54
post-install:
44
	@${SED} 's@%PREFIX%@${LOCALBASE}@g' ${FILESDIR}/munin-node.sh > ${PREFIX}/etc/rc.d/munin-node.sh
55
	@${SED} 's@%PREFIX%@${LOCALBASE}@g' ${STARTSTOP_SRC} > ${STARTSTOP_DST}
45
	@${CHMOD} +x ${PREFIX}/etc/rc.d/munin-node.sh
56
	@${CHMOD} +x ${STARTSTOP_DST}
57
	${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
46
	@if [ ! -f ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf ]; then \
59
	@if [ ! -f ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf ]; then \
47
		${INSTALL_DATA} ${WRKSRC}/plugins.conf ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf; \
60
		${INSTALL_DATA} ${WRKSRC}/plugins.conf ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf; \
48
	fi
61
	fi
(-)ports/sysutils/munin-node/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
MD5 (munin_1.0.3.tar.gz) = 8114e4d716e0ec7ac70357a697af28cf
1
MD5 (munin_1.0.4.tar.gz) = 00721181e1ff81be85ad89307457d998
2
SIZE (munin_1.0.3.tar.gz) = 214362
2
SIZE (munin_1.0.4.tar.gz) = 214902
(-)ports/sysutils/munin-node/files/munin-node.sh (-1 / +7 lines)
Lines 14-20 Link Here
14
		if [ -f $CONFIG ]; then
14
		if [ -f $CONFIG ]; then
15
			PIDFILE=`awk '$1 == "pid_file" { print $2 }' $CONFIG`
15
			PIDFILE=`awk '$1 == "pid_file" { print $2 }' $CONFIG`
16
			if [ -f $PIDFILE ]; then
16
			if [ -f $PIDFILE ]; then
17
				/bin/kill `cat $PIDFILE` && echo -n ' munin-node'
17
				PID=`cat $PIDFILE`
18
				CMD=`ps -xa -o command -p $PID | sed 1d`
19
				case "$CMD" in
20
				*munin-node*)
21
					/bin/kill $PID && echo -n ' munin-node'
22
					;;
23
				esac
18
			fi
24
			fi
19
		fi
25
		fi
20
	;;
26
	;;
(-)ports/sysutils/munin-node/files/munin_node.sh (+28 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
4
# PROVIDE: munin-node
5
# REQUIRE: DAEMON
6
# BEFORE:  cron
7
# KEYWORD: FreeBSD
8
9
#
10
# Add the following lines to /etc/rc.conf to enable munin-node:
11
# munin_node_enable (bool):      Set to "NO" by default.
12
#                                Set it to "YES" to enable munin-node
13
# munin_node_config (path):      Set to "%PREFIX%/etc/munin/munin-node.conf" by default.
14
#
15
16
. /etc/rc.subr
17
18
name="munin_node"
19
rcvar=`set_rcvar`
20
21
[ -z "$munin_node_enable" ] && munin_node_enable="NO"
22
[ -z "$munin_node_config" ] && munin_node_config="/usr/local/etc/munin/munin-node.conf"
23
24
command="/usr/local/sbin/munin-node"
25
pidfile=`awk '$1 == "pid_file" { print $2 }' $munin_node_config`
26
27
load_rc_config $name
28
run_rc_command "$1"
(-)ports/sysutils/munin-node/files/patch-cpu.in (+15 lines)
Line 0 Link Here
1
--- munin-1.0.4.orig/node/node.d.freebsd/cpu.in	Sun May  9 21:18:35 2004
2
+++ munin-1.0.4/node/node.d.freebsd/cpu.in	Sat Nov 20 15:32:50 2004
3
@@ -59,10 +59,10 @@
4
 	OSV=`/sbin/sysctl -n kern.osrelease | cut -f1 -d.`
5
 	if [ "$OSV" = "4" ]; then
6
 		STATUNITS=`/sbin/sysctl -n kern.clockrate | cut -f16 -d' '`
7
-	elif [ "$OSV" = "5" ]; then
8
+	elif [ "$OSV" -ge "5" ]; then
9
 		STATUNITS=`/sbin/sysctl -n kern.clockrate | cut -f13 -d' '`
10
 	fi
11
-#	PERCENT=`/sbin/sysctl -n hw.ncpu | awk '{print ($1)*100}'`
12
+	PERCENT=`/sbin/sysctl -n hw.ncpu | awk '{print ($1)*100}'`
13
 	SCALE=`echo 'scale=5;' $PERCENT/$STATUNITS | bc -q `
14
 	NCPU=`/sbin/sysctl -n hw.ncpu`
15
 	if [ "$scaleto100" = yes ]; then
(-)ports/sysutils/munin-node/files/patch-vmstat.in (+29 lines)
Line 0 Link Here
1
--- munin-1.0.4.orig/node/node.d.freebsd/vmstat.in	Sun Feb  1 19:59:54 2004
2
+++ munin-1.0.4/node/node.d.freebsd/vmstat.in	Sat Nov 20 14:14:54 2004
3
@@ -32,7 +32,7 @@
4
 OSV=`/sbin/sysctl -n kern.osrelease | cut -f1 -d.`
5
 
6
 if [ "$1" = "autoconf" ]; then
7
-	if [ "$OSV" = "5" ]; then
8
+	if [ "$OSV" -ge "5" ]; then
9
 		/sbin/sysctl -n vm.vmtotal 2>/dev/null >/dev/null
10
 		RESULT=$?
11
 		NAME=/sbin/sysctl
12
@@ -59,7 +59,7 @@
13
 	echo 'graph_title VMstat'
14
 	echo 'graph_args --base 1000 -l 0'
15
 	echo 'graph_vlabel process states'
16
-	if [ "$OSV" = "5" ]; then
17
+	if [ "$OSV" -ge "5" ]; then
18
 		echo 'running.label running'
19
 		echo 'running.type GAUGE'
20
 		echo 'diskwait.label diskwait'
21
@@ -77,7 +77,7 @@
22
 	exit 0
23
 fi
24
 
25
-if [ "$OSV" = "5" ]; then
26
+if [ "$OSV" -ge "5" ]; then
27
 	sysctl -n vm.vmtotal | awk '
28
 /^Processes:/ {
29
 	print "running.value", $3;
(-)ports/sysutils/munin-node/files/pkg-message (-3 / +11 lines)
Lines 5-12 Link Here
5
5
6
Please edit it according to your needs.
6
Please edit it according to your needs.
7
7
8
The Munin client will be started at system boot automatically.
8
********************************************************************
9
You can start it manually with:
9
10
    %%PREFIX%%/etc/rc.d/munin-node.sh start
10
The Munin client will *not* be started automatically. To allow it
11
to start, put this line in /etc/rc.conf:
12
13
munin_node_enable="YES"
14
15
Then, it will be started on the next boot. To start it now, use
16
this command:
17
18
    /etc/rc.d/munin_node start
11
********************************************************************
19
********************************************************************
12
20
(-)ports/sysutils/munin-node/files/pkg-message.4 (+12 lines)
Line 0 Link Here
1
2
********************************************************************
3
Unless this file already existed, a sample configuration file
4
has been placed in %%PREFIX%%/etc/munin/munin-node.conf.
5
6
Please edit it according to your needs.
7
8
The Munin client will be started at system boot automatically.
9
You can start it manually with:
10
    %%PREFIX%%/etc/rc.d/munin-node.sh start
11
********************************************************************
12
(-)ports/sysutils/munin-node/pkg-deinstall (-2 / +10 lines)
Lines 36-43 Link Here
36
}
36
}
37
37
38
stop_process() {
38
stop_process() {
39
    if [ -x ${PKG_PREFIX}/etc/rc.d/munin-node.sh ]; then
39
    if [ -x $STARTSTOP ]; then
40
	${PKG_PREFIX}/etc/rc.d/munin-node.sh stop
40
	$STARTSTOP stop
41
    fi
41
    fi
42
}
42
}
43
43
Lines 51-59 Link Here
51
    fi
51
    fi
52
}
52
}
53
53
54
OSVERSION=`/sbin/sysctl -n kern.osreldate`
55
if [ $OSVERSION -lt 500000 ]; then
56
    STARTSTOP=${PKG_PREFIX}/etc/rc.d/munin-node.sh
57
else
58
    STARTSTOP=/etc/rc.d/munin_node
59
fi
60
54
case $2 in
61
case $2 in
55
    DEINSTALL)
62
    DEINSTALL)
56
	stop_process
63
	stop_process
64
	exit 0 # ignore error
57
	;;
65
	;;
58
    POST-DEINSTALL)
66
    POST-DEINSTALL)
59
	delete_group munin
67
	delete_group munin
(-)ports/sysutils/munin-node/pkg-plist (-4 / +11 lines)
Lines 1-7 Link Here
1
@comment etc/munin/VERSION.node must remain for upgrade version check
1
@comment etc/munin/VERSION.node must remain for upgrade version check
2
etc/munin/munin-node.conf
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
3
etc/munin/plugin-conf.d/plugins.conf
3
etc/munin/munin-node.conf.sample
4
etc/rc.d/munin-node.sh
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
5
etc/munin/plugin-conf.d/plugins.conf.sample
6
@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
5
sbin/munin-node
8
sbin/munin-node
6
sbin/munin-node-configure
9
sbin/munin-node-configure
7
sbin/munin-run
10
sbin/munin-run
Lines 73-79 Link Here
73
@unexec rmdir %D/%%DATADIR%% 2>/dev/null || true
76
@unexec rmdir %D/%%DATADIR%% 2>/dev/null || true
74
@unexec rmdir %D/etc/munin/plugin-conf.d 2>/dev/null || true
77
@unexec rmdir %D/etc/munin/plugin-conf.d 2>/dev/null || true
75
@unexec rmdir %D/etc/munin 2>/dev/null || true
78
@unexec rmdir %D/etc/munin 2>/dev/null || true
79
@unexec echo
80
@unexec echo '********************************************************************'
76
@unexec echo "If you want to *completely* remove munin-node, you have to"
81
@unexec echo "If you want to *completely* remove munin-node, you have to"
77
@unexec echo "    rm -rf %D/var/munin and %D/etc/munin %D/www/data/munin"
82
@unexec echo "    rm -rf %D/var/munin %D/etc/munin %D/www/data/munin"
78
@unexec echo "They have to be left on the system because you may be performing"
83
@unexec echo "They have to be left on the system because you may be performing"
79
@unexec echo "an update. This process can't tell."
84
@unexec echo "an update. This process can't tell."
85
@unexec echo '********************************************************************'
86
@unexec echo

Return to bug 74166