aboutsummaryrefslogtreecommitdiff
path: root/sysutils/ganglia-monitor-core
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2006-07-13 21:52:02 +0000
committerBrooks Davis <brooks@FreeBSD.org>2006-07-13 21:52:02 +0000
commit2a56fd900105d52cd30228d8d9946e85905ff45b (patch)
tree068ef79314cbba6769d32da7bb082fb61421037b /sysutils/ganglia-monitor-core
parent45d9062b84a6c692b9f0c8ebdb5438a691ab1efd (diff)
downloadports-2a56fd900105d52cd30228d8d9946e85905ff45b.tar.gz
ports-2a56fd900105d52cd30228d8d9946e85905ff45b.zip
Notes
Diffstat (limited to 'sysutils/ganglia-monitor-core')
-rw-r--r--sysutils/ganglia-monitor-core/Makefile33
-rw-r--r--sysutils/ganglia-monitor-core/distinfo6
-rw-r--r--sysutils/ganglia-monitor-core/files/ganglia.sh.in2
-rw-r--r--sysutils/ganglia-monitor-core/files/gmetad.sh.in60
-rw-r--r--sysutils/ganglia-monitor-core/files/gmond.sh.in25
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-ganglia.pod18
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-gmetad_conf.c14
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-gmetad_gmetad.conf18
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-gmond_g25__config.c14
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-lib_libgmond.c23
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-srclib_libmetrics_freebsd_metrics.c64
11 files changed, 113 insertions, 164 deletions
diff --git a/sysutils/ganglia-monitor-core/Makefile b/sysutils/ganglia-monitor-core/Makefile
index 1e91600daf5c..59bff459afb8 100644
--- a/sysutils/ganglia-monitor-core/Makefile
+++ b/sysutils/ganglia-monitor-core/Makefile
@@ -6,14 +6,9 @@
#
PORTNAME= monitor-core
-PORTVERSION= 3.0.1
-PORTREVISION= 3
+PORTVERSION= 3.0.3
CATEGORIES= sysutils net parallel
-.if !defined(PORTDEV)
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
-.else
-MASTER_SITES= http://matt-massie.com/%SUBDIR%/
-.endif
MASTER_SITE_SUBDIR= ganglia
PKGNAMEPREFIX= ganglia-
.if defined(CLUSTER)
@@ -34,9 +29,6 @@ CONFIGURE_ENV= CFLAGS="${_CFLAGS}" LDFLAGS="${_LDFLAGS}"
_CFLAGS= ${CFLAGS} -I${LOCALBASE}/include ${PTHREAD_CFLAGS}
_LDFLAGS= ${LDFLAGS} -L${LOCALBASE}/lib
-USE_BZIP2= yes
-USE_RC_SUBR= ganglia.sh
-
SUB_FILES= pkg-install
.if defined (GMETAD_CONF)
@@ -57,6 +49,19 @@ GMOND_CONF= ${WRKDIR}/gmond.conf
.include <bsd.port.pre.mk>
+# The daemons should use seperate scripts, but prior to 6.1 they won't
+# run in the right order. In those cases we use the old monolythic
+# script.
+.if (${OSVERSION} >= 700007 || ( ${OSVERSION} < 700000 && ${OSVERSION} >= 600101))
+USE_RC_SUBR= gmond.sh
+.if defined (WITH_GMETAD)
+USE_RC_SUBR+= gmetad.sh
+.endif
+.else
+USE_RC_SUBR= ganglia.sh
+.endif
+
+
.if defined (WITH_GMETAD)
LIB_DEPENDS= rrd.2:${PORTSDIR}/net/rrdtool
CONFIGURE_ARGS+= --with-gmetad
@@ -95,12 +100,22 @@ FIX_CONF_FILES= ganglia.pod \
FIX_DB_FILES= ganglia.pod \
gmetad/conf.c \
gmetad/gmetad.conf
+FIX_USER_FILES= ganglia.pod \
+ gmetad/conf.c \
+ gmetad/gmetad.conf \
+ gmond/conf.pod \
+ gmond/gmond.conf.5 \
+ gmond/gmond.conf.html \
+ gmond/g25_config.c \
+ lib/libgmond.c
post-patch:
${REINPLACE_CMD} -e "s|/etc/\(gm[a-z]*d.conf\)|${PREFIX}/etc/\1|g" \
${FIX_CONF_FILES:S|^|${WRKSRC}/|}
${REINPLACE_CMD} -e "s|/var/lib/ganglia|/var/db/ganglia|g" \
${FIX_DB_FILES:S|^|${WRKSRC}/|}
+ ${REINPLACE_CMD} -e "s|nobody|ganglia|g" \
+ ${FIX_USER_FILES:S|^|${WRKSRC}/|}
post-build:
${WRKSRC}/gmond/gmond -t > ${WRKDIR}/gmond.conf
diff --git a/sysutils/ganglia-monitor-core/distinfo b/sysutils/ganglia-monitor-core/distinfo
index e6297436fbc3..51d2094f2f0f 100644
--- a/sysutils/ganglia-monitor-core/distinfo
+++ b/sysutils/ganglia-monitor-core/distinfo
@@ -1,3 +1,3 @@
-MD5 (ganglia-3.0.1.tar.bz2) = 14f086834f91899d921bf7e7fe44b536
-SHA256 (ganglia-3.0.1.tar.bz2) = 5806fef3d43e57988032b2ce757e6e12a24d68185664868a5b5c6781b7f0656e
-SIZE (ganglia-3.0.1.tar.bz2) = 2649342
+MD5 (ganglia-3.0.3.tar.gz) = c48320a112db20e8372ae8e89d97583e
+SHA256 (ganglia-3.0.3.tar.gz) = 02e6272aa5f614a5ea3336c8cc4e1cdcd794893114d08dda39188c010154deab
+SIZE (ganglia-3.0.3.tar.gz) = 2824785
diff --git a/sysutils/ganglia-monitor-core/files/ganglia.sh.in b/sysutils/ganglia-monitor-core/files/ganglia.sh.in
index f02b30ee376a..f1790eb369a7 100644
--- a/sysutils/ganglia-monitor-core/files/ganglia.sh.in
+++ b/sysutils/ganglia-monitor-core/files/ganglia.sh.in
@@ -2,7 +2,7 @@
# $FreeBSD$
# PROVIDE: ganglia
-# REQIORE: DAEMON
+# REQUIRE: DAEMON
# KEYWORD: shutdown
# XXX: This should really be two seperate scripts with rcorder
diff --git a/sysutils/ganglia-monitor-core/files/gmetad.sh.in b/sysutils/ganglia-monitor-core/files/gmetad.sh.in
new file mode 100644
index 000000000000..9f2ad11e2526
--- /dev/null
+++ b/sysutils/ganglia-monitor-core/files/gmetad.sh.in
@@ -0,0 +1,60 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: gmetad
+# REQUIRE: gmond
+# KEYWORD: shutdown
+
+. %%RC_SUBR%%
+
+name=gmetad
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/${name}"
+start_precmd="gmetad_prestart"
+stop_postcmd="gmetad_poststop"
+
+gmetad_prestart()
+{
+ if [ ! -d ${gmetasnap_rrddir} ]; then
+ mkdir -p ${gmetasnap_rrddir}
+ fi
+ chown ganglia:ganglia ${gmetasnap_rrddir}
+ if checkyesno gmetasnap_enable; then
+ if [ ! -d ${gmetasnap_snapdir} ]; then
+ mkdir -p ${gmetasnap_snapdir}
+ chown ganglia:ganglia ${gmetasnap_snapdir}
+ fi
+ if [ `ls ${gmetasnap_rrddir} | egrep -v ^.snap | wc -l` -eq 0 ]; then
+ ${gmetasnap_command} -r ${gmetasnap_rrddir} \
+ -s ${gmetasnap_snapdir} ${gmetasnap_flags} \
+ restore ${gmetasnap_snapname}
+ fi
+ fi
+}
+
+gmetad_poststop()
+{
+ if checkyesno gmetasnap_enable; then
+ ${gmetasnap_command} -r ${gmetasnap_rrddir} \
+ -s ${gmetasnap_snapdir} ${gmetasnap_flags} \
+ save ${gmetasnap_snapname}
+ fi
+}
+
+load_rc_config ganglia
+
+load_rc_config $name
+
+gmetad_enable=${gmetad_enable-NO}
+gmetad_conf=${gmetad_conf-%%PREFIX%%/etc/gmetad.conf}
+
+gmetasnap_enable=${gmetasnap_enable-NO}
+gmetasnap_rrddir=${gmetasnap_rrddir-/var/db/ganglia/rrds}
+gmetasnap_snapdir=${gmetasnap_snapdir-/var/db/ganglia/snaps}
+gmetasnap_snapname=${gmetasnap_snapname-snap}
+gmetasnap_command=${gmetasnap_command-%%PREFIX%%/sbin/gmetasnap}
+
+command_args="-c ${gmetad_conf}"
+required_files=${gmetad_conf}
+
+run_rc_command $*
diff --git a/sysutils/ganglia-monitor-core/files/gmond.sh.in b/sysutils/ganglia-monitor-core/files/gmond.sh.in
new file mode 100644
index 000000000000..ec66b3e174f8
--- /dev/null
+++ b/sysutils/ganglia-monitor-core/files/gmond.sh.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: gmond
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+
+. %%RC_SUBR%%
+
+name=gmond
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/${name}"
+
+load_rc_config ganglia
+
+load_rc_config $name
+
+gmond_enable=${gmond_enable-NO}
+gmond_conf=${gmond_conf-%%PREFIX%%/etc/gmond.conf}
+
+command_args="-c ${gmond_conf}"
+required_files=${gmond_conf}
+
+run_rc_command $*
diff --git a/sysutils/ganglia-monitor-core/files/patch-ganglia.pod b/sysutils/ganglia-monitor-core/files/patch-ganglia.pod
deleted file mode 100644
index 9647438e6fcc..000000000000
--- a/sysutils/ganglia-monitor-core/files/patch-ganglia.pod
+++ /dev/null
@@ -1,18 +0,0 @@
-
-$FreeBSD$
-
---- ganglia.pod.orig
-+++ ganglia.pod
-@@ -451,9 +451,9 @@
- # setuid off
- #
- #-------------------------------------------------------------------------------
-- # User gmetad will setuid to (defaults to "nobody")
-- # default: "nobody"
-- # setuid_username "nobody"
-+ # User gmetad will setuid to (defaults to "ganglia")
-+ # default: "ganglia"
-+ # setuid_username "ganglia"
- #
- #-------------------------------------------------------------------------------
- # The port gmetad will answer requests for XML
diff --git a/sysutils/ganglia-monitor-core/files/patch-gmetad_conf.c b/sysutils/ganglia-monitor-core/files/patch-gmetad_conf.c
deleted file mode 100644
index 12bc6ee6482b..000000000000
--- a/sysutils/ganglia-monitor-core/files/patch-gmetad_conf.c
+++ /dev/null
@@ -1,14 +0,0 @@
-
-$FreeBSD$
-
---- gmetad/conf.c.orig
-+++ gmetad/conf.c
-@@ -249,7 +249,7 @@
- config->trusted_hosts = NULL;
- config->debug_level = 0;
- config->should_setuid = 1;
-- config->setuid_username = "nobody";
-+ config->setuid_username = "ganglia";
- config->rrd_rootdir = "/var/lib/ganglia/rrds";
- config->scalable_mode = 1;
- config->all_trusted = 0;
diff --git a/sysutils/ganglia-monitor-core/files/patch-gmetad_gmetad.conf b/sysutils/ganglia-monitor-core/files/patch-gmetad_gmetad.conf
deleted file mode 100644
index 8d0b13d54724..000000000000
--- a/sysutils/ganglia-monitor-core/files/patch-gmetad_gmetad.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-
-$FreeBSD$
-
---- gmetad/gmetad.conf.orig Mon May 12 14:58:40 2003
-+++ gmetad/gmetad.conf Tue Oct 28 11:11:03 2003
-@@ -80,9 +80,9 @@
- # setuid off
- #
- #-------------------------------------------------------------------------------
--# User gmetad will setuid to (defaults to "nobody")
--# default: "nobody"
--# setuid_username "nobody"
-+# User gmetad will setuid to (defaults to "ganglia")
-+# default: "ganglia"
-+# setuid_username "ganglia"
- #
- #-------------------------------------------------------------------------------
- # The port gmetad will answer requests for XML
diff --git a/sysutils/ganglia-monitor-core/files/patch-gmond_g25__config.c b/sysutils/ganglia-monitor-core/files/patch-gmond_g25__config.c
deleted file mode 100644
index faf21c8520ba..000000000000
--- a/sysutils/ganglia-monitor-core/files/patch-gmond_g25__config.c
+++ /dev/null
@@ -1,14 +0,0 @@
-
-$FreeBSD$
-
---- gmond/g25_config.c.orig
-+++ gmond/g25_config.c
-@@ -228,7 +228,7 @@
- config->deaf = 0;
- config->debug_level = 0;
- config->no_setuid = 0;
-- config->setuid = conf_strdup("nobody");
-+ config->setuid = conf_strdup("ganglia");
- config->no_gexec = 0;
- config->all_trusted = 0;
- config->host_dmax = 0;
diff --git a/sysutils/ganglia-monitor-core/files/patch-lib_libgmond.c b/sysutils/ganglia-monitor-core/files/patch-lib_libgmond.c
deleted file mode 100644
index 93e5fad0824f..000000000000
--- a/sysutils/ganglia-monitor-core/files/patch-lib_libgmond.c
+++ /dev/null
@@ -1,23 +0,0 @@
-
-$FreeBSD$
-
---- lib/libgmond.c.orig
-+++ lib/libgmond.c
-@@ -39,7 +39,7 @@
- static cfg_opt_t globals_opts[] = {
- CFG_BOOL("daemonize", 1, CFGF_NONE),
- CFG_BOOL("setuid", 1, CFGF_NONE),
-- CFG_STR("user", "nobody", CFGF_NONE),
-+ CFG_STR("user", "ganglia", CFGF_NONE),
- /* later i guess we should add "group" as well */
- CFG_INT("debug_level", 0, CFGF_NONE),
- CFG_INT("max_udp_msg_len", 1472, CFGF_NONE),
-@@ -125,7 +125,7 @@
- The values closely match ./gmond/metric.h definitions in 2.5.x */ \n\
- globals { \n\
- setuid = yes \n\
-- user = nobody \n\
-+ user = ganglia \n\
- cleanup_threshold = 300 /*secs */ \n\
- } \n\
- \n\
diff --git a/sysutils/ganglia-monitor-core/files/patch-srclib_libmetrics_freebsd_metrics.c b/sysutils/ganglia-monitor-core/files/patch-srclib_libmetrics_freebsd_metrics.c
deleted file mode 100644
index 0a655c4fd4da..000000000000
--- a/sysutils/ganglia-monitor-core/files/patch-srclib_libmetrics_freebsd_metrics.c
+++ /dev/null
@@ -1,64 +0,0 @@
-
-$FreeBSD$
-
---- srclib/libmetrics/freebsd/metrics.c.orig
-+++ srclib/libmetrics/freebsd/metrics.c
-@@ -151,16 +151,51 @@
- cpu_speed_func ( void )
- {
- g_val_t val;
-- int cpu_speed;
-- size_t len = sizeof(cpu_speed);
-+ char buf[1024];
-+ char *curptr;
-+ size_t len;
-+ long freq = 0, tmpfreq;
-
- /*
-- * machdep.tsc_freq is an i386/amd64 only feature, but it's the best
-- * we've got at the moment.
-+ * If the system supports it, the cpufreq driver provides the best
-+ * access to CPU frequency. Since we want a constant value, we're
-+ * looking for the maximum frequency, not the current one. We
-+ * don't know what order the driver will report values in so we
-+ * search for the highest one by parsing the string returned by the
-+ * dev.cpu.0.freq_levels sysctl. The format of the string is a space
-+ * seperated list of MHz/milliwatts.
- */
-- if (sysctlbyname("machdep.tsc_freq", &cpu_speed, &len, NULL, 0) == -1)
-- cpu_speed = 0;
-- val.uint16 = cpu_speed /= 1000000;
-+ tmpfreq = 0;
-+ len = sizeof(buf);
-+ if (sysctlbyname("dev.cpu.0.freq_levels", buf, &len, NULL, 0) == -1)
-+ buf[0] = '\0';
-+ curptr = buf;
-+ while (isdigit(curptr[0])) {
-+ freq = strtol(curptr, &curptr, 10);
-+ if (freq > tmpfreq)
-+ tmpfreq = freq;
-+ /* Skip the rest of this entry */
-+ while (!isspace(curptr[0]) && curptr[0] != '\0')
-+ curptr++;
-+ /* Find the next entry */
-+ while (!isdigit(curptr[0]) && curptr[0] != '\0')
-+ curptr++;
-+ }
-+ freq = tmpfreq;
-+ if (tmpfreq != 0)
-+ goto done;
-+
-+ /*
-+ * machdep.tsc_freq exists on some i386/amd64 machines and gives the
-+ * CPU speed in Hz. If it exists it's a decent value.
-+ */
-+ if (sysctlbyname("machdep.tsc_freq", &tmpfreq, &len, NULL, 0) != -1) {
-+ freq = (double)tmpfreq / 1e6;
-+ goto done;
-+ }
-+
-+done:
-+ val.uint32 = freq;
-
- return val;
- }