diff options
author | brooks <brooks@FreeBSD.org> | 2005-04-16 05:19:46 +0800 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2005-04-16 05:19:46 +0800 |
commit | bcc0ce2ae8c189cc62bdabd29219f8b8015822c8 (patch) | |
tree | cd5429707b7c0ca923f9f677266d4cad53687c83 | |
parent | f0025c3612c9bc77d65135f454cfc86369b00bb6 (diff) | |
download | freebsd-ports-gnome-bcc0ce2ae8c189cc62bdabd29219f8b8015822c8.tar.gz freebsd-ports-gnome-bcc0ce2ae8c189cc62bdabd29219f8b8015822c8.tar.zst freebsd-ports-gnome-bcc0ce2ae8c189cc62bdabd29219f8b8015822c8.zip |
Upgrade to 3.0.1. This includes some fixes plus all the changes I
previously patched into the FreeBSD metrics.
Try to use cpufreq to get the frequency (maximum frequency not the
current one).
Add code to selectivly install libganglia and don't install it by
default as ganglia is linked staticly and no one I know of actually uses
the library.
Add some Makefile features to the port to allow generation of custom
pacakges with custom config files.
PR: ports/79770
-rw-r--r-- | sysutils/ganglia-monitor-core/Makefile | 69 | ||||
-rw-r--r-- | sysutils/ganglia-monitor-core/distinfo | 4 | ||||
-rw-r--r-- | sysutils/ganglia-monitor-core/files/patch-srclib_libmetrics_freebsd_metrics.c | 575 | ||||
-rw-r--r-- | sysutils/ganglia-monitor-core/pkg-plist | 14 |
4 files changed, 109 insertions, 553 deletions
diff --git a/sysutils/ganglia-monitor-core/Makefile b/sysutils/ganglia-monitor-core/Makefile index 45cecd712476..be090e25b5d8 100644 --- a/sysutils/ganglia-monitor-core/Makefile +++ b/sysutils/ganglia-monitor-core/Makefile @@ -6,12 +6,19 @@ # PORTNAME= monitor-core -PORTVERSION= 3.0.0 -PORTREVISION= 2 +PORTVERSION= 3.0.1 +PORTREVISION= 0 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) +PKGNAMESUFFIX= -${CLUSTER} +.endif DISTNAME= ganglia-${PORTVERSION} MAINTAINER= brooks@FreeBSD.org @@ -19,7 +26,8 @@ COMMENT= Ganglia cluster monitor, monitoring daemon PKGINSTALL= ${WRKSRC}/pkg-install -OPTIONS+= GMETAD "include gmetad" on +OPTIONS+= GMETAD "include gmetad" on \ + LIBGANGLIA "include libganglia" off GNU_CONFIGURE= yes CONFIGURE_ENV= CFLAGS="${_CFLAGS}" LDFLAGS="${_LDFLAGS}" @@ -32,19 +40,39 @@ USE_RC_SUBR= ganglia.sh SUB_FILES= pkg-install +.if defined (GMETAD_CONF) +.if !exists (${GMETAD_CONF}) +IGNORE= "GMETAD_CONF must point to an existing file when defined" +.endif +.else +GMETAD_CONF= ${WRKSRC}/gmetad/gmetad.conf +.endif + +.if defined (GMOND_CONF) +.if !exists (${GMOND_CONF}) +IGNORE= "GMOND_CONF must point to an existing file when defined" +.endif +.else +GMOND_CONF= ${WRKDIR}/gmond.conf +.endif + .include <bsd.port.pre.mk> .if defined (WITH_GMETAD) LIB_DEPENDS= rrd.0:${PORTSDIR}/net/rrdtool CONFIGURE_ARGS+= --with-gmetad -.endif -INSTALLS_SHLIB= yes -.if !defined (WITH_GMETAD) +PLIST_SUB+= GMETAD= +SUB_LIST+= GMETAD= +.else PLIST_SUB+= GMETAD="@comment " SUB_LIST+= GMETAD="\#" +.endif + +.if defined (WITH_LIBGANGLIA) +INSTALLS_SHLIB= yes +PLIST_SUB+= LIBGANGLIA= .else -PLIST_SUB+= GMETAD= -SUB_LIST+= GMETAD= +PLIST_SUB+= LIBGANGLIA="@comment " .endif MAN1= gmetric.1 gmond.1 gstat.1 @@ -78,22 +106,25 @@ post-patch: post-build: ${WRKSRC}/gmond/gmond -t > ${WRKDIR}/gmond.conf -post-install: +do-install: +.if defined (WITH_GMETAD) + cd ${WRKSRC}/gmetad && make install + ${INSTALL_MAN} ${WRKSRC}/mans/gmetad.1 ${MANPREFIX}/man/man1 + ${INSTALL_DATA} ${GMETAD_CONF} ${PREFIX}/etc/gmetad.conf.sample +.endif + cd ${WRKSRC}/gmetric && make install ${INSTALL_MAN} ${WRKSRC}/mans/gmetric.1 ${MANPREFIX}/man/man1 + cd ${WRKSRC}/gmond && make install ${INSTALL_MAN} ${WRKSRC}/mans/gmond.1 ${MANPREFIX}/man/man1 ${INSTALL_MAN} ${WRKSRC}/gmond/gmond.conf.5 ${MANPREFIX}/man/man5 ${INSTALL_MAN} ${WRKSRC}/mans/gstat.1 ${MANPREFIX}/man/man1 -.if defined (WITH_GMETAD) - ${INSTALL_MAN} ${WRKSRC}/mans/gmetad.1 ${MANPREFIX}/man/man1 -.endif - ${INSTALL_DATA} ${WRKDIR}/gmond.conf ${PREFIX}/etc/gmond.conf.sample -.if defined (WITH_GMETAD) - ${INSTALL_DATA} ${WRKSRC}/gmetad/gmetad.conf \ - ${PREFIX}/etc/gmetad.conf.sample - @if [ ! -f ${CONF_DIR}/gmetad.conf ]; then \ - ${INSTALL_DATA} ${WRKSRC}/gmetad/gmetad.conf ${CONF_DIR} ;\ - fi + ${INSTALL_DATA} ${GMOND_CONF} ${PREFIX}/etc/gmond.conf.sample +.if defined (WITH_LIBGANGLIA) + cd ${WRKSRC}/lib && make install + ${INSTALL_SCRIPT} ${WRKSRC}/ganglia-config ${PREFIX}/bin .endif + +post-install: ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .include <bsd.port.post.mk> diff --git a/sysutils/ganglia-monitor-core/distinfo b/sysutils/ganglia-monitor-core/distinfo index f481fbaed1ea..bbb3b3f9c5fe 100644 --- a/sysutils/ganglia-monitor-core/distinfo +++ b/sysutils/ganglia-monitor-core/distinfo @@ -1,2 +1,2 @@ -MD5 (ganglia-3.0.0.tar.bz2) = 62e514a34fb237dfb0649608d8a9377a -SIZE (ganglia-3.0.0.tar.bz2) = 2528890 +MD5 (ganglia-3.0.1.tar.bz2) = 14f086834f91899d921bf7e7fe44b536 +SIZE (ganglia-3.0.1.tar.bz2) = 2649342 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 index afcf5704c747..d438cbdf60c1 100644 --- a/sysutils/ganglia-monitor-core/files/patch-srclib_libmetrics_freebsd_metrics.c +++ b/sysutils/ganglia-monitor-core/files/patch-srclib_libmetrics_freebsd_metrics.c @@ -3,537 +3,62 @@ $FreeBSD$ --- srclib/libmetrics/freebsd/metrics.c.orig +++ srclib/libmetrics/freebsd/metrics.c -@@ -6,7 +6,7 @@ - * Fixed libkvm code. - * Tue Jul 15 16:42:22 EST 2003 - * -- * $Id: metrics.c,v 1.4 2005/01/29 01:24:01 brooks_en_davis Exp $ -+ * $Id: metrics.c,v 1.5 2005/03/04 21:22:32 brooks_en_davis Exp $ - */ - #include <stdio.h> - #include <stdlib.h> -@@ -47,10 +47,16 @@ - #define MIN_NET_POLL_INTERVAL 0.5 - #endif - -+#ifndef MIN_CPU_POLL_INTERVAL -+#define MIN_CPU_POLL_INTERVAL 0.5 -+#endif -+ - #ifndef UINT64_MAX - #define UINT64_MAX ULLONG_MAX - #endif - -+#define VFCF_NONLOCAL (VFCF_NETWORK|VFCF_SYNTHETIC|VFCF_LOOPBACK) -+ - #define timertod(tvp) \ - ((double)(tvp)->tv_sec + (double)(tvp)->tv_usec/(1000*1000)) - -@@ -111,23 +117,18 @@ - kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "metric_init()"); - } else { - /* -- * Versions of FreeBSD with the swap mib generally have a version -+ * RELEASE versions of FreeBSD with the swap mib have a version - * of libkvm that doesn't need root for simple proc access so we -- * just open /dev/null to give us a working handle here. This is -- * bogus, but only a few pre-release versions of 5.0 are -- * affected by the bogosity and people running those should -- * upgrade. -+ * just open /dev/null to give us a working handle here. - */ - kd = kvm_open(_PATH_DEVNULL, NULL, NULL, O_RDONLY, "metric_init()"); - use_vm_swap_info = 1; - } - pagesize = getpagesize(); - -- /* -- * Call get_netbw once to initalize the counters. -- */ -- -+ /* Initalize some counters */ - get_netbw(NULL, NULL, NULL, NULL); -+ cpu_state(-1); - - val.int32 = SYNAPSE_SUCCESS; - return val; -@@ -152,12 +153,15 @@ - g_val_t val; - int cpu_speed; - size_t len = sizeof(cpu_speed); -- if (sysctlbyname("machdep.tsc_freq", &cpu_speed, &len, NULL, 0) == -1) -- val.uint16 = 0; - -- /* machdep.tsc_freq doesn't seem to always be present. At least on -- my FreeBSD 4 systems. The experts say it gives cpu speed, tho. */ -+ /* -+ * machdep.tsc_freq is an i386/amd64 only feature, but it's the best -+ * we've got at the moment. -+ */ -+ if (sysctlbyname("machdep.tsc_freq", &cpu_speed, &len, NULL, 0) == -1) -+ cpu_speed = 0; - val.uint16 = cpu_speed /= 1000000; -+ - return val; - } - -@@ -166,16 +170,14 @@ - { - g_val_t val; - size_t len; -- int total; -- int mib[2]; -+ long total; - -- mib[0] = CTL_HW; -- mib[1] = HW_PHYSMEM; -- len = sizeof (total); -+ len = sizeof(total); -+ -+ if (sysctlbyname("hw.physmem", &total, &len, NULL, 0) == -1) -+ total = 0; -+ val.uint32 = total / 1024; - -- sysctl(mib, 2, &total, &len, NULL, 0); -- total /= 1024; -- val.uint32 = total; - return val; - } - -@@ -216,17 +218,14 @@ - boottime_func ( void ) +@@ -151,16 +151,51 @@ + cpu_speed_func ( void ) { g_val_t val; -- struct timeval boottime; -- int mib[2]; -+ struct timeval boottime; - size_t size; - -- mib[0] = CTL_KERN; -- mib[1] = KERN_BOOTTIME; - size = sizeof(boottime); -- if (sysctl(mib, 2, &boottime, &size, NULL, 0) == -1) -- val.uint32 = 0; -+ if (sysctlbyname("kern.boottime", &boottime, &size, NULL, 0) == -1) -+ boottime.tv_sec = 0; - -- val.uint32 = boottime.tv_sec; -+ val.uint32 = (uint32_t) boottime.tv_sec; - - return val; - } -@@ -243,49 +242,40 @@ - g_val_t - machine_type_func ( void ) - { -- g_val_t val; -- char machine_type[MAX_G_STRING_SIZE]; -- size_t len = MAX_G_STRING_SIZE; -- if (sysctlbyname("hw.machine", &machine_type, &len, NULL, 0) == -1 || !len) -- strncpy( val.str, "x86", MAX_G_STRING_SIZE ); -+ g_val_t val; -+ size_t len = sizeof(val.str); - -- strncpy( val.str, machine_type, MAX_G_STRING_SIZE ); -- return val; -+ if (sysctlbyname("hw.machine", val.str, &len, NULL, 0) == -1 || -+ (len == 0)) -+ strlcpy(val.str, "unknown", sizeof(val.str)); -+ -+ return val; - } - - g_val_t - os_name_func ( void ) - { -- g_val_t val; -- char osname[MAX_G_STRING_SIZE]; -- size_t len = MAX_G_STRING_SIZE; -- if (sysctlbyname("kern.ostype", &osname, &len, NULL, 0) == -1 || !len) -- strncpy( val.str, "FreeBSD", MAX_G_STRING_SIZE ); -+ g_val_t val; -+ size_t len = sizeof(val.str); - -- strncpy( val.str, osname, MAX_G_STRING_SIZE ); -- -- return val; -+ if (sysctlbyname("kern.ostype", val.str, &len, NULL, 0) == -1 || -+ (len == 0)) -+ strlcpy(val.str, "FreeBSD (unknown)", sizeof(val.str)); -+ -+ return val; - } - - g_val_t - os_release_func ( void ) - { -- g_val_t val; -- int mib[2]; -- size_t len; -- char *prefix, buf[1024]; -- -- prefix = ""; -- -- mib[0] = CTL_KERN; -- mib[1] = KERN_OSRELEASE; -- len = sizeof(buf); -- if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) -- strncpy( val.str, "Unknown", MAX_G_STRING_SIZE ); -+ g_val_t val; -+ size_t len = sizeof(val.str); - -- strncpy( val.str, buf, MAX_G_STRING_SIZE ); -+ if (sysctlbyname("kern.osrelease", val.str, &len, NULL, 0) == -1 || -+ (len == 0)) -+ strlcpy(val.str, "unknown", sizeof(val.str)); - -- return val; -+ return val; - } - - /* Get the CPU state given by index, from kern.cp_time -@@ -294,21 +284,37 @@ - */ - int cpu_state(int which) { - -- static long cp_time[CPUSTATES]; -+ long cp_time[CPUSTATES]; -+ long cp_diff[CPUSTATES]; - static long cp_old[CPUSTATES]; -- static long cp_diff[CPUSTATES]; - static int cpu_states[CPUSTATES]; -- static long tot; -+ static struct timeval this_time, last_time; -+ struct timeval time_diff; - size_t len = sizeof(cp_time); -+ int i; -+ -+ if (which == -1) { -+ bzero(cp_old, sizeof(cp_old)); -+ bzero(&last_time, sizeof(last_time)); -+ return 0.0; +- 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; + -+ gettimeofday(&this_time, NULL); -+ timersub(&this_time, &last_time, &time_diff); -+ if (timertod(&time_diff) < MIN_CPU_POLL_INTERVAL) { -+ goto output; -+ } -+ last_time = this_time; - -- /* Copy the last cp_time into cp_old */ -- memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); - /* puts kern.cp_time array into cp_time */ -- if (sysctlbyname("kern.cp_time", &cp_time, &len, NULL, 0) == -1 || !len) -+ if (sysctlbyname("kern.cp_time", &cp_time, &len, NULL, 0) == -1) { -+ warn("kern.cp_time"); - return 0.0; ++ /* ++ * 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; + } - /* Use percentages function lifted from top(1) to figure percentages */ -- tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); -+ percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); - -+output: - return cpu_states[which]; - } - -@@ -316,10 +322,9 @@ - cpu_user_func ( void ) - { - g_val_t val; -- int res; - -- res = cpu_state(CP_USER); -- val.f = (float)res/10; -+ val.f = (float) cpu_state(CP_USER)/10; -+ - return val; - } - -@@ -327,10 +332,8 @@ - cpu_nice_func ( void ) - { - g_val_t val; -- int res; - -- res = cpu_state(CP_NICE); -- val.f = (float)res/10; -+ val.f = (float) cpu_state(CP_NICE)/10; - - return val; - } -@@ -339,10 +342,8 @@ - cpu_system_func ( void ) - { - g_val_t val; -- int res; - -- res = cpu_state(CP_SYS); -- val.f = (float)res/10; -+ val.f = (float) cpu_state(CP_SYS)/10; - - return val; - } -@@ -351,16 +352,14 @@ - cpu_idle_func ( void ) - { - g_val_t val; -- int res; - -- res = cpu_state(CP_IDLE); -- val.f = (float)res/10; -+ val.f = (float) cpu_state(CP_IDLE)/10; - - return val; - } - - /* --** FIXME -+** FIXME - This metric is not valid on FreeBSD. - */ - g_val_t - cpu_wio_func ( void ) -@@ -372,7 +371,8 @@ - } - - /* --** FIXME -+** FIXME - Idle time since startup. The scheduler apparently knows -+** this, but we it's fairly pointless so it's not exported. - */ - g_val_t - cpu_aidle_func ( void ) -@@ -382,19 +382,18 @@ - return val; - } - --/* --** FIXME --*/ - g_val_t - cpu_intr_func ( void ) - { - g_val_t val; -- val.f = 0.0; -+ -+ val.f = (float) cpu_state(CP_INTR)/10; -+ - return val; - } - - /* --** FIXME -+** FIXME - This metric is not valid on FreeBSD. - */ - g_val_t - cpu_sintr_func ( void ) -@@ -412,6 +411,7 @@ - - getloadavg(load, 3); - val.f = load[0]; -+ - return val; - } - -@@ -422,8 +422,8 @@ - double load[3]; - - getloadavg(load, 3); -- - val.f = load[1]; -+ - return val; - } - -@@ -435,6 +435,7 @@ - - getloadavg(load, 3); - val.f = load[2]; -+ - return val; - } - -@@ -442,14 +443,9 @@ - proc_total_func ( void ) - { - g_val_t val; -- int mib[3]; -- size_t len; -- -- mib[0] = CTL_KERN; -- mib[1] = KERN_PROC; -- mib[2] = KERN_PROC_ALL; -+ size_t len = 0; - -- sysctl(mib, 3, NULL, &len, NULL, 0); -+ sysctlbyname("kern.proc.all", NULL, &len, NULL, 0); - - val.uint32 = (len / sizeof (struct kinfo_proc)); - -@@ -457,9 +453,6 @@ - } - - --/* -- * Don't know how to do this yet.. -- */ - g_val_t - proc_run_func( void ) - { -@@ -501,6 +494,12 @@ - return val; - } - -+/* -+** FIXME - The whole ganglia model of memory is bogus. Free memory is -+** generally a bad idea with a modern VM and so is reporting it. There -+** is simply no way to report a value for "free" memory that makes any -+** kind of sense. Free+inactive might be a decent value for "free". -+*/ - g_val_t - mem_free_func ( void ) - { -@@ -516,15 +515,25 @@ - return val; - } - -+/* -+** FreeBSD don't seem to report this anywhere. It's actually quite -+** complicated as there is SysV shared memory, POSIX shared memory, -+** and mmap shared memory at a minimum. -+*/ - g_val_t - mem_shared_func ( void ) - { - g_val_t val; - - val.uint32 = 0; + - return val; - } ++done: ++ val.uint16 = freq; -+/* -+** FIXME - this isn't really valid. It lists some VFS buffer space, -+** but the real picture is much more complex. -+*/ - g_val_t - mem_buffers_func ( void ) - { -@@ -541,6 +550,10 @@ return val; } - -+/* -+** FIXME - this isn't really valid. It lists some VM cache space, -+** but the real picture is more complex. -+*/ - g_val_t - mem_cached_func ( void ) - { -@@ -790,8 +803,6 @@ - * at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change. - */ - -- -- - static float - find_disk_space(double *total, double *tot_avail) - { -@@ -911,6 +922,7 @@ - makenetvfslist(void) - { - char *str = NULL, *strptr, **listptr = NULL; -+ size_t slen; - int cnt, i; - - #if __FreeBSD_version > 500000 -@@ -938,15 +950,16 @@ - goto done; - } - -- for (cnt = 0, i = 0; i < maxvfsconf; i++) { -- if (xvfsp->vfc_flags & (VFCF_NETWORK|VFCF_SYNTHETIC|VFCF_LOOPBACK)) { -- listptr[cnt++] = strdup(xvfsp->vfc_name); -- if (listptr[cnt-1] == NULL) { -- warnx("malloc failed"); -- goto done; -- } -+ for (cnt = 0; cnt < maxvfsconf; xvfsp++) { -+ if (xvfsp->vfc_flags & VFCF_NONLOCAL) -+ continue; -+ -+ listptr[cnt] = strdup(xvfsp->vfc_name); -+ if (listptr[cnt] == NULL) { -+ warnx("malloc failed"); -+ goto done; - } -- xvfsp++; -+ cnt++; - } - #else - int mib[3], maxvfsconf; -@@ -966,31 +979,45 @@ - goto done; - } - -- for (ptr = getvfsent(); ptr; ptr = getvfsent()) -- if (ptr->vfc_flags & (VFCF_NETWORK|VFCF_SYNTHETIC|VFCF_LOOPBACK)) { -- listptr[cnt++] = strdup(ptr->vfc_name); -- if (listptr[cnt-1] == NULL) { -- warnx("malloc failed"); -- goto done; -- } -+ cnt = 0; -+ while ((ptr = getvfsent()) != NULL && cnt < maxvfsconf) { -+ if (ptr->vfc_flags & VFCF_NONLOCAL) -+ continue; -+ -+ listptr[cnt] = strdup(ptr->vfc_name); -+ if (listptr[cnt] == NULL) { -+ warnx("malloc failed"); -+ goto done; - } -+ cnt++; -+ } - #endif - - if (cnt == 0) - goto done; - -- if ((str = malloc(sizeof(char) * (32 * cnt + cnt + 2))) == NULL) { -+ /* -+ * Count up the string lengths, we need a extra byte to hold -+ * the between entries ',' or the NUL at the end. -+ */ -+ for (i = 0; i < cnt; i++) -+ slen = strlen(listptr[i]) + 1; -+ /* Add 2 for initial "no". */ -+ slen += 2; -+ -+ if ((str = malloc(slen)) == NULL) { - warnx("malloc failed"); - goto done; - } - -- *str = 'n'; *(str + 1) = 'o'; -+ str[0] = 'n'; -+ str[1] = 'o'; - for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { -- strncpy(strptr, listptr[i], 32); -+ strcpy(strptr, listptr[i]); - strptr += strlen(listptr[i]); - *strptr = ','; - } -- *(--strptr) = '\0'; -+ *strptr = '\0'; - - done: - #if __FreeBSD_version > 500000 -@@ -1044,7 +1071,6 @@ - if (timertod(&time_diff) < MIN_NET_POLL_INTERVAL) { - goto output; - } -- - - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) - errx(1, "iflist-sysctl-estimate"); diff --git a/sysutils/ganglia-monitor-core/pkg-plist b/sysutils/ganglia-monitor-core/pkg-plist index 98ad3d376c9e..94cf3339b3fc 100644 --- a/sysutils/ganglia-monitor-core/pkg-plist +++ b/sysutils/ganglia-monitor-core/pkg-plist @@ -1,17 +1,17 @@ @comment $FreeBSD$ -bin/ganglia-config +%%LIBGANGLIA%%bin/ganglia-config bin/gstat bin/gmetric @unexec if cmp -s %D/etc/gmond.conf %D/etc/gmond.conf.sample; then rm -f %D/etc/gmond.conf; fi etc/gmond.conf.sample %%GMETAD%%@unexec if cmp -s %D/etc/gmetad.conf %D/etc/gmetad.conf.sample; then rm -f %D/etc/gmetad.conf; fi %%GMETAD%%etc/gmetad.conf.sample -include/ganglia.h -lib/libganglia-3.0.0.so.0 -lib/libganglia-3.0.0.so -lib/libganglia.so -lib/libganglia.la -lib/libganglia.a +%%LIBGANGLIA%%include/ganglia.h +%%LIBGANGLIA%%lib/libganglia-3.0.0.so.0 +%%LIBGANGLIA%%lib/libganglia-3.0.0.so +%%LIBGANGLIA%%lib/libganglia.so +%%LIBGANGLIA%%lib/libganglia.la +%%LIBGANGLIA%%lib/libganglia.a %%GMETAD%%sbin/gmetad sbin/gmond @unexec rmdir %D/var/db/ganglia/rrds 2>/dev/null || true |