From 2d5d16935fc737120eda763a1210b951aa80d214 Mon Sep 17 00:00:00 2001 From: brooks Date: Wed, 19 Oct 2011 20:34:16 +0000 Subject: Fix a bug where the install target was overwriting gmetad.conf due to code in the source tree. Refactor the gmond rc.d script to allow multiple gmond daemons to be run by making links to the script. For example a link to gmond-cluster would let you set gmond_cluster_enable and gmond_cluster_conf variables to control a second instance. --- sysutils/ganglia-monitor-core/Makefile | 4 ++-- sysutils/ganglia-monitor-core/files/gmond.sh.in | 16 +++++++++------- .../ganglia-monitor-core/files/patch-gmetad_Makefile.in | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 sysutils/ganglia-monitor-core/files/patch-gmetad_Makefile.in (limited to 'sysutils') diff --git a/sysutils/ganglia-monitor-core/Makefile b/sysutils/ganglia-monitor-core/Makefile index fa9a404a8e7f..99ed13da770b 100644 --- a/sysutils/ganglia-monitor-core/Makefile +++ b/sysutils/ganglia-monitor-core/Makefile @@ -7,7 +7,7 @@ PORTNAME= monitor-core PORTVERSION= 3.1.7 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils net parallel MASTER_SITES= SF/ganglia/ganglia%20monitoring%20core/${PORTVERSION} PKGNAMEPREFIX= ganglia- @@ -33,7 +33,7 @@ LIBTOOLFILES= configure libmetrics/configure GNU_CONFIGURE= yes CONFIGURE_ARGS= --enable-setuid=ganglia --enable-setgid=ganglia -CONFIGURE_ENV= GANGLIA_ACK_SYSCONFDIR=1 +CONFIGURE_ENV= GANGLIA_ACK_SYSCONFDIR=1 "LDFLAGS=${LDFLAGS}" CFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib diff --git a/sysutils/ganglia-monitor-core/files/gmond.sh.in b/sysutils/ganglia-monitor-core/files/gmond.sh.in index 44ba46ae767e..95e78ddefa65 100644 --- a/sysutils/ganglia-monitor-core/files/gmond.sh.in +++ b/sysutils/ganglia-monitor-core/files/gmond.sh.in @@ -5,21 +5,23 @@ # REQUIRE: DAEMON # KEYWORD: shutdown +bname=`basename $0` . /etc/rc.subr -name=gmond +name=`echo "${bname}" | tr ".-" "__"` rcvar=`set_rcvar` -command="%%PREFIX%%/sbin/${name}" +command="%%PREFIX%%/sbin/gmond" load_rc_config ganglia -load_rc_config $name +load_rc_config $bname -gmond_enable=${gmond_enable-NO} -gmond_conf=${gmond_conf-%%PREFIX%%/etc/gmond.conf} +eval "${name}_enable=\${${name}_enable-NO}" +eval "conffile=\${${name}_conf-%%PREFIX%%/etc/${bname}.conf}" -command_args="-c ${gmond_conf}" -required_files=${gmond_conf} +pidfile="/var/run/${bname}.pid" +command_args="-c ${conffile} -p ${pidfile}" +required_files=${conffile} run_rc_command $* diff --git a/sysutils/ganglia-monitor-core/files/patch-gmetad_Makefile.in b/sysutils/ganglia-monitor-core/files/patch-gmetad_Makefile.in new file mode 100644 index 000000000000..dcb7d57c3cd8 --- /dev/null +++ b/sysutils/ganglia-monitor-core/files/patch-gmetad_Makefile.in @@ -0,0 +1,14 @@ + +$FreeBSD$ + +--- gmetad/Makefile.in.orig ++++ gmetad/Makefile.in +@@ -539,8 +539,6 @@ + $(FIXCONFIG) gmetad.conf.in + + install-data-hook: gmetad.conf +- mkdir -p $(DESTDIR)$(sysconfdir) && \ +- $(INSTALL_DATA) gmetad.conf $(DESTDIR)$(sysconfdir)/gmetad.conf + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: -- cgit